Skip to content
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

Incorrect redundant bracket warning with Template Haskell and type applications #1153

Closed
expipiplus1 opened this issue Oct 24, 2020 · 3 comments
Labels

Comments

@expipiplus1
Copy link
Contributor

Hlint says that this bracket is redundant, but without it the parse returns the operator @$ instead, and I believe TypeApplications requires no space between the @ and the type, hence the bracket is necessary here:

foo = [|get @($r)|]

Almost the opposite of #558

@ndmitchell ndmitchell added the bug label Oct 25, 2020
@ndmitchell
Copy link
Owner

Indeed, a curious find. We have the blanket rule that if an atom is surrounded by brackets then those brackets are redundant. But that's clearly not the case here, so I think we'll need to figure out a better way to express this concept.

@ndmitchell
Copy link
Owner

After taking a closer look, its a weird one, because the @ is an expression, but the ($r) is a type. I've made it so that splice types aren't necessarily atomic, which fixes this bug. It might remove some potential warnings, but given the number of splices in types its probably not that high.

@expipiplus1
Copy link
Contributor Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants