Repository navigation
Description
Your environment
Which OS do you use? ArchLinux
Which version of GHC do you use and how did you install it? 9.14.1 from GHCup
How is your project built (alternative: link to the project)? See repro steps below.
Which LSP client (editor/plugin) do you use? terminal vim + YCM
Which version of HLS do you use and how did you install it? 2.14.0.0 from GHCup
Have you configured HLS in any way (especially: a hie.yaml file)? No
Steps to reproduce
Define this function
foo = case _ :: VEither [String,Int] Bool ofand trigger case-split.
Expected behaviour
The plugin should add these lines:
VLeft _ -> _
VRight _ -> _Actual behaviour
This line is added:
Data.Variant.VEither.VEither _ -> _which is wrong because VEither value constructor is not exported from its module, only the type constructor is.
Debug information
The issue is, the diagnostic looks like this:
Pattern match(es) are non-exhaustive
In a case alternative:
Patterns of type ‘VEither [String, Int] Bool’ not matched:
Data.Variant.VEither.VEither (Variant _ _) [GHC-62161]
and since the plugin inspects that to propose the change… well, there's nothing much we can do right now, except maybe returning no action at all.
But surely the first step is to understand what the diagnostic is actually telling us. I should probably look up into this Ok, that was actually easy. The issue is that GHC is suggesting us to use a data constructor, VEither thing.VEither that we can't really use because it's not exported by its module. This issue was already reported to GHC. We'd want instead, that it suggested us to use the two pattern synonyms VLeft and VRight.
Activity