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

Autogenerated imports create a lot of unused import warnings #55

Open
jgrosso opened this issue Sep 16, 2019 · 0 comments
Open

Autogenerated imports create a lot of unused import warnings #55

jgrosso opened this issue Sep 16, 2019 · 0 comments
Assignees
Labels
bug A bona fide implementation mistake. errors Anything related to Axel's error messages or error handling. macro expansion Anything related to Axel macro expansion.

Comments

@jgrosso
Copy link
Collaborator

jgrosso commented Sep 16, 2019

The user shouldn't be bothered by the warnings of the form:

<file path>: warning: [-Wunused-imports]
    The qualified import of ‘Prelude’ is redundant
      except perhaps to import instances from ‘Prelude’
    To import instances alone, use: import Prelude()
  |
2 | import qualified Prelude as GHCPrelude
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

<file path>:3:1: warning: [-Wunused-imports]
    The qualified import of ‘Axel.Parse.AST’ is redundant
      except perhaps to import instances from ‘Axel.Parse.AST’
    To import instances alone, use: import Axel.Parse.AST()
  |
3 | import qualified Axel.Parse.AST as AST
  | ^^

These modules are auto-imported by Axel, and thus the user has no way to fix the warnings anyway.

Two potential solutions are:

  1. Filter such warnings out of GHC-generated output. Easier(?), but hackier.
  2. Avoid auto-importing these modules if they're not actually used in the files in question (e.g. there are no quotations in the file).
@jgrosso jgrosso changed the title Filter out unused import warnings for autogenerated imports Autogenerated imports create a lot of unused import warnings Sep 16, 2019
@jgrosso jgrosso added bug A bona fide implementation mistake. errors Anything related to Axel's error messages or error handling. labels Sep 16, 2019
@jgrosso jgrosso added the macro expansion Anything related to Axel macro expansion. label Sep 24, 2019
@jgrosso jgrosso self-assigned this Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bona fide implementation mistake. errors Anything related to Axel's error messages or error handling. macro expansion Anything related to Axel macro expansion.
Projects
None yet
Development

No branches or pull requests

1 participant