-
Notifications
You must be signed in to change notification settings - Fork 195
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
Setting Language Disables Other Extensions #1604
Comments
Just ran into this too, specifically with GHC2021 & TemplateHaskell; (hlint 3.6.1) |
if you pass nothing, hlint will decide for itself what extensions to enable based on the principle of being able to parse as broad a set of haskell as possible. if you pass (i should point out, this is the behavior on the command line i'm talking about - i haven't looked at what happens with arguments passed in .hlint.yaml files before - maybe there's an issue with that?) |
This doesn't appear to work (3.6.1) neither as command line arguments nor arguments in the yaml file.
module Example where
example = $(something) With command args∀ hlint -XGHC2021 -XTemplateHaskell Example.hs
Example.hs:3:11: Error: Parse error: on input `$'
Found:
module Example where
> example = $(something)
1 error With config file
- arguments:
- -XGHC2021
- -XTemplateHaskell ∀ hlint --hint=example.hlint.yaml Example.hs
Example.hs:3:11: Error: Parse error: on input `$'
Found:
module Example where
> example = $(something)
1 error Only TemplateHaskell (no GHC2021)∀ hlint -XTemplateHaskell Example.hs
No hints |
quick test here with v3.8 on the command line seems to confirm the reported issue |
i still haven't quite worked out what is up with this but i have a workaround: |
i put a fix up for this in #1619. bit surprised, i knew that we'd looked at |
While configuring my
.hlint.yaml
file for my Yesod project I ran into a strange issue. I decided to dump all mydefault-extensions
as arguments into hlint just to ensure correct parsing. I'm using GHC2021 so I also wanted to pass-XGHC2021
. The minimal example I can give is using template haskell:This should work just fine to my understanding, in fact
-XTemplateHaskell
is probably redundant because I believe hlint automatically enables it. Either way this produces warnings all over the place of the form:Removing
-XGHC2021
from the arguments list fixes the issue and the warnings no longer show. My guess is that selecting the language version ignores any other extensions. The issue is also present using-XHaskell2010
.As an aside to this, it would be nice if hlint could automatically detect and use the
language
version /default-extensions
frompackage.yaml
to avoid the need for these arguments entirely. This seems to happen via HLS in VSCode but does not happen when runninghlint
manually via the command line.The text was updated successfully, but these errors were encountered: