jfmengels / elm-review

Analyzes Elm projects, to help find mistakes before your users find them.
https://package.elm-lang.org/packages/jfmengels/elm-review/latest/
Other
252 stars 13 forks source link

Fix let function arguments not registering with the correct module name #159

Closed jfmengels closed 1 year ago

jfmengels commented 1 year ago

@r-k-b noticed a bug in the lookup table implementation:

module A exposing (..)
import B exposing (someValue)

a =
    let
        b someValue =
            someValue <-- This one
    in
    someValue

The module name for the someValue tagged above (inside the body of b) was resolved a [ "B" ], which is incorrect and should be [], as the parameter name shadows the import.

This PR fixes the issue by correctly considering let functions to have a scope with their own variable bindings.