mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-08-16 19:40:22 +03:00
Fix let function arguments not registering with the correct module name
This commit is contained in:
parent
84aae3b64b
commit
929d8508fd
@ -1220,11 +1220,28 @@ expressionEnterVisitor node context =
|
||||
(\declaration scopes ->
|
||||
case Node.value declaration of
|
||||
Expression.LetFunction function ->
|
||||
registerVariable
|
||||
{ variableType = LetVariable
|
||||
, node = (Node.value function.declaration).name
|
||||
}
|
||||
scopes
|
||||
let
|
||||
{ name, expression, arguments } =
|
||||
Node.value function.declaration
|
||||
|
||||
withLetVariable : NonEmpty Scope
|
||||
withLetVariable =
|
||||
registerVariable
|
||||
{ variableType = LetVariable
|
||||
, node = name
|
||||
}
|
||||
scopes
|
||||
in
|
||||
if List.isEmpty arguments then
|
||||
withLetVariable
|
||||
|
||||
else
|
||||
let
|
||||
names : Dict String VariableInfo
|
||||
names =
|
||||
collectNamesFromPattern PatternVariable arguments Dict.empty
|
||||
in
|
||||
NonEmpty.mapHead (\scope -> { scope | cases = ( expression, names ) :: scope.cases }) withLetVariable
|
||||
|
||||
Expression.LetDestructuring _ _ ->
|
||||
scopes
|
||||
|
@ -93,6 +93,10 @@ a = localValue
|
||||
True
|
||||
Just
|
||||
Cmd.none
|
||||
(let foo get = get
|
||||
in
|
||||
get
|
||||
)
|
||||
(+)
|
||||
(117 + 3)
|
||||
(<?>)
|
||||
@ -155,6 +159,8 @@ Http.get -> Http.get
|
||||
<nothing>.True -> Basics.True
|
||||
<nothing>.Just -> Maybe.Just
|
||||
Cmd.none -> Platform.Cmd.none
|
||||
<nothing>.get -> <nothing>.get
|
||||
<nothing>.get -> Http.get
|
||||
<nothing>.+ -> Basics.+
|
||||
<nothing>.+ -> Basics.+
|
||||
<nothing>.<?> -> Url.Parser.<?>
|
||||
@ -689,6 +695,9 @@ collectPatterns lookupFunction context node =
|
||||
Pattern.AsPattern subPattern _ ->
|
||||
collectPatterns lookupFunction context subPattern
|
||||
|
||||
Pattern.VarPattern _ ->
|
||||
[]
|
||||
|
||||
_ ->
|
||||
Debug.todo ("Other patterns in case expressions are not handled: " ++ Debug.toString node)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user