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

Suggest adding -Wno-orphans when orphans are encountered #571

Closed
expipiplus1 opened this issue Nov 6, 2020 · 5 comments · Fixed by #1235
Closed

Suggest adding -Wno-orphans when orphans are encountered #571

expipiplus1 opened this issue Nov 6, 2020 · 5 comments · Fixed by #1235
Labels
status: in discussion Not actionable, because discussion is still ongoing or there's no decision yet type: enhancement New feature or request

Comments

@expipiplus1
Copy link
Contributor

It's one of the warning I disable most frequently (in application code only of course!).

I wonder if it's even worth not suggesting this in library code, or if the inconsistency would just be confusing.

Just an idea, I'm sure it's not to everyone's taste!

@jneira jneira added type: enhancement New feature or request status: in discussion Not actionable, because discussion is still ongoing or there's no decision yet labels Nov 6, 2020
@ndmitchell
Copy link
Collaborator

We definitely shouldn't suggest it unless the user has explicitly asked for it. Do you believe we do so?

I think more generally an action available on any warning should be to disable the warning. I don't think people should use it too often, but it's a nice time saver.

@expipiplus1
Copy link
Contributor Author

Do I believe we do what, sorry?

This certainly does generalize to any warning, but nearly all warnings I squash properly except for this one which I almost always ignore. Perhaps it would be better just to leave it in my ghc-opts.

Perhaps this warning ignoring suggestion could be general, but also parameterized by the user for which ones to trigger on

@Anrock
Copy link
Contributor

Anrock commented Nov 6, 2020

Ignore <warning name> for line and Ignore <warning name> for file is pretty common code actions for warnings in other servers. GHC can't ignore warning for specific line, IIRC, but generic Ignore <warning name> for module and Ignore <warning name> for project makes sense to me.

@jneira
Copy link
Member

jneira commented Nov 6, 2020

👍
That option also exists in java ides, you can disable warnings per project (so the ide calls the compiler with the appropiate flags) or it suggests you add the proper annotation to disable it for a concrete definition (class, method or variable).

@ndmitchell
Copy link
Collaborator

@expipiplus1 - I believe that unless you have explicitly asked for it, we won't warn on orphans, so you must have turned it on in your project. Probably through -Wall.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: in discussion Not actionable, because discussion is still ongoing or there's no decision yet type: enhancement New feature or request
Projects
None yet
4 participants