Internal Error ghcide-code-actions-imports-exports
arising from usage of erroneous type constructor as a term due to incorrect import
#3978
Labels
component: imports plugin
type: bug
Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
The circumstances in which this is manifested seem strangely specific, I might have mistitled. Essentially, when you try to use a type constructor as a data constructor,
to the right of an arrow which pattern matches on any constructorin curtain situations, and where a data constructor with the same name as the type constructor is within "adding an identifier to existing import" away from HLS, this error manifests. More details on rep.Your environment
Which OS do you use?
Linux 6.7.0, NixOS, 24.05 (Uakari), 24.05.20240108.317484b
Which version of GHC do you use, and how did you install it?
Version 9.4.8, installed via nixpkgs
How is your project built (alternative: link to the project)?
N/A
Which LSP client (editor/plugin) do you use?
VS Codium+vscode-haskell
Which version of HLS do you use, and how did you install it?
haskell-language-server version: 2.4.0.0 (GHC: 9.4.8), nixpkgs
Have you configured HLS in any way (especially: a
hie.yaml
file)?No
Steps to reproduce
As the cursor finishes writing
Sum
(OnVSCode
at least), internal error pop-ups will start to show up, hovering over it as well.Scenarios I have tested
in all these cases, there are normal errors, ❌ (triggered) or ✅ (didn't trigger) only concerns if it triggered an internal error
Explicit secondary module
Bug.hs
BugBase.hs
:The above
BugBase.hs
causes the internal error onFoo
atBug.hs
, ifBugBase.hs
had:data Foo = MkFoo
No internal error is caused.
If we add a pattern synonym with the name
Foo
, once again it errors onBug.hs
:Debug information
The pop-up error (slightly formatted):
The text was updated successfully, but these errors were encountered: