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

Alex generates code with unqualified imports, e.g. of GHC.Exts #258

Closed
andreasabel opened this issue Feb 27, 2024 · 0 comments · Fixed by #259
Closed

Alex generates code with unqualified imports, e.g. of GHC.Exts #258

andreasabel opened this issue Feb 27, 2024 · 0 comments · Fixed by #259
Labels
Milestone

Comments

@andreasabel
Copy link
Member

jukebox-0.5.4 broke with GHC 9.4 because a new export Symbol form GHC.Exts clashes with a user-defined identifier of the same name. This is pretty bad, as it is inconvenient for the user to work around this.

Unqualified imports in generated code are just a ticking time bomb. It makes packages using Alex brittle. (And there is no material need for unqualified imports.)

The way forward here is to change Alex so that all its identifiers it imports are used qualified, so that there is no risk of clashing with user-defined identifiers.

See a parallel effort in BNFC:

@andreasabel andreasabel added this to the 3.5.1.0 milestone Feb 27, 2024
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Apr 12, 2024
## Changes in 3.5.1.0

* Drop generating output for GHC < 6.4.
* Use qualified imports in generated code (except for `Prelude`)
  ([Issue #258](haskell/alex#258)).
* Suppress warnings `tabs` and `unused-imports` for generated code
  ([Issue #255](haskell/alex#255)).
* Tested with GHC 8.0 - 9.8.2.

## Changes in 3.5.0.0

 * Add option `--numeric-version`.
 * Remove deprecated `-v` as alias for `--version`.
 * Add `-v` as placeholder for a future `--verbose` option.
 * Make `alex{G,S}etUserState` available with the `monadUserState-bytestring` wrapper
   ([Issue #220](haskell/alex#220)).
 * Debugging lexer: print character in addition to its ASCII code
   ([PR #252](haskell/alex#252)).
 * Tested with GHC 8.0 - 9.8.1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant