-
-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prelude.head: empty list
eval result when main
function present
#4139
Comments
Awesome analysis! Well, the use of I can not reproduce the issue with ghc 9.4.8, so some assumption might be violated nowadays. Can you write a failing test case? I think it is weird that such a trivial example fails, but the hls-eval test suite is green. I am afraid, I don't have much more insight than that, we currently don't have any active maintainers for this plugin. |
I only now see I forgot to add emphasis this detail 😅 I tried number of GHC version, but the only problematic ones are the one listed, i.e., 9.8.x. I was not able to replicate with prior versions of the GHC.
Definitely. I created a fork, but can't seem to make it run in the CI. Would you be able to help out with that perhaps? |
Just open a PR with your changes against our repo with what you got, that's totally fine. We will allow running the CI on your PR. |
Opened here |
It is caused by this commit |
We can switch from Oh, it seems |
Added the |
Your environment
OS: macOS 13.2.1 (22D68)
GHC: 9.8.1, and 9.8.2
LSP: 2.2.0.0, 2.5.0.0, 2.6.0.0, 2.7.0.0, and head
LSP Plugin:
hls-eval-plugin
Steps to reproduce
I tried a number of of combinations of GHC/LSP/file setup, but it seems that with GHC 9.8.x any time when there's a
main
function present in the module, the result after evaluation isPrelude.head: empty list
.E.g.
Expected behaviour
Actual behaviour
Debug information
After a bit of debugging myself, I found the error originating from this use of
head
. After a bit of tinkering, it seems that the underlying hscParsedDecls function, whichTyThings
output is[Identifier `$trModule']
, rather than the expected[Identifier `evalPrint', Identifier `$trModule']
.As the problem seems to arise from the GHC, I am not quite sure whether there's a bug in GHC, or Eval plugin implementation is working under the wrong assumptions.
I am happy to try to fix this if someone is able to provide some additional direction/advice.
The text was updated successfully, but these errors were encountered: