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

Typed holes always appear as errors, even when deferred #256

Open
georgefst opened this issue Jul 30, 2020 · 6 comments
Open

Typed holes always appear as errors, even when deferred #256

georgefst opened this issue Jul 30, 2020 · 6 comments
Labels
component: ghcide type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@georgefst
Copy link
Collaborator

Does anyone know why, even with -fdefer-typed-holes, holes are reported as errors rather than warnings?

I've been curious about this for a while, but it hasn't caused my any real issues until now, when it gets in the way of using the Eval plugin.

@georgefst
Copy link
Collaborator Author

Okay, actually, my mistake. It doesn't get in the way of evaluation, I just had a typo in the flag name.

In which case, the only issue is seemingly the minor annoyance that these appear in red rather than yellow...

@lukel97
Copy link
Collaborator

lukel97 commented Jul 30, 2020

The warnings appear in red?

@georgefst
Copy link
Collaborator Author

That is to say, in VScode for example, warnings from -Wtyped-holes appear as errors rather than warnings, which is inconsistent with GHC.

I'm not sure if there's really a practical distinction other than the colour and the little badge.

@lukel97 lukel97 added the type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. label Jul 31, 2020
pepeiborra pushed a commit that referenced this issue Dec 27, 2020
Running the simplifier is necessary to do things like inline data
constructor wrappers.

Fixes #256 and #393
@michaelpj
Copy link
Collaborator

Does this still happen?

@georgefst georgefst changed the title Typed holes never deferred Typed holes always appear as errors, even when deferred Aug 10, 2022
@georgefst
Copy link
Collaborator Author

I've learnt to live with it, but yes.

I think I looked in to it at some point, and the problem is that HLS always defers holes. And then explicitly decides to label them errors, so as not to confuse users who haven't set -fdefer-typed-holes.

I'd expect any errors (as opposed to warnings) in the editor to indicate that my code won't run.

@michaelpj
Copy link
Collaborator

Here's the problematic logic:

We shouldn't un-defer things if the user specified to defer them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ghcide type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

4 participants