Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Add a test case involving -fno-warn-missing-signatures #720

Merged
merged 3 commits into from
Sep 3, 2020

Conversation

zliu41
Copy link
Contributor

@zliu41 zliu41 commented Aug 4, 2020

I was trying to run ghcide on https://github.com/agda/agda, and the majority of the modules failed. What I observed was

  • Agda.cabal declares missing signatures as fatal (-Werror=missing-signatures)
  • Lexer.hs (a generated file) has missing signatures, but it disables the warning by {-# OPTIONS_GHC -fno-warn-missing-signatures #-}.
  • However, ghcide still failed to typecheck Lexer.hs, citing missing signatures. Lexer.hs is transitively imported by a lot of modules.

This PR fixes it by only enabling non-fatal warnings in DynFlags.

@wz1000
Copy link
Collaborator

wz1000 commented Aug 29, 2020

Seems reasonable to me, but I think a better way to achieve the same goal would be to strip out -Werror entirely. Maybe we can still "upgrade" the -Werror diagnostics to errors when presenting them to the user, like we do for type errors.

@wz1000
Copy link
Collaborator

wz1000 commented Aug 29, 2020

I recommend closing this since it should be fixed by #738. Thanks for bringing attention to this!

@pepeiborra
Copy link
Collaborator

I agree that #738 is a better solution but the test in this PR is still relevant.
@zliu41 would you be able to edit the PR down to the tests, and rebase?

Copy link
Collaborator

@pepeiborra pepeiborra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edit the PR down to the tests

@zliu41
Copy link
Contributor Author

zliu41 commented Sep 3, 2020

Ok cool, I confirmed that the problem is resolved in HEAD.
Reverted the change and only keeping the test.
Thanks @wz1000 @pepeiborra !

@zliu41 zliu41 requested a review from pepeiborra September 3, 2020 02:11
@zliu41 zliu41 changed the title Only enable non-fatal warnings Add a test case involving -fno-warn-missing-signatures Sep 3, 2020
@pepeiborra pepeiborra merged commit 599b27a into haskell:master Sep 3, 2020
@zliu41 zliu41 deleted the wopt_set_nonfatal branch September 3, 2020 04:55
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
…e#720)

* Only enable non-fatal warnings

* Revert the change since it has been taken care of in haskell/ghcide#738
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
…e#720)

* Only enable non-fatal warnings

* Revert the change since it has been taken care of in haskell/ghcide#738
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
…e#720)

* Only enable non-fatal warnings

* Revert the change since it has been taken care of in haskell/ghcide#738
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants