Fix module name lookup table for pattern matching in case expressions

We were using moduleNameForType internally instead of moduleNameForValue,
which only worke when the name of the custom type is the same as the
name of the custom type constructor.
This commit is contained in:
Jeroen Engels 2020-09-23 10:14:05 +02:00
parent c2488a06b0
commit 5ebf38e283

View File

@ -5118,7 +5118,7 @@ collectModuleNamesFromPattern context pattern =
List.concatMap (collectModuleNamesFromPattern context) subPatterns
Pattern.NamedPattern { moduleName, name } subPatterns ->
( Node.range pattern, moduleNameForType context name moduleName ) :: List.concatMap (collectModuleNamesFromPattern context) subPatterns
( Node.range pattern, moduleNameForValue context name moduleName ) :: List.concatMap (collectModuleNamesFromPattern context) subPatterns
Pattern.AsPattern subPattern _ ->
collectModuleNamesFromPattern context subPattern