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

Fix disabling implicit prelude #812

Merged

Conversation

rprije
Copy link

@rprije rprije commented Oct 8, 2020

Setting the default-extension NoImplicitPrelude in .cabal files had no effect. Turning on -Wimplicit-prelude revealed Prelude still gets loaded implicitly. eg:

common/src/Common/Route.hs:1:1: warning: [-Wimplicit-prelude]
    Module `Prelude' implicitly imported

Debugging revealed NoImplicitPrelude was not being included in the LANGUAGE pragma heading added by the ob preprocessor. This is because NoImplicitPrelude in Cabal is considered to be a disabling of the ImplicitPrelude extension and ob was ignoring disabled extensions. This PR adds support for disabled extensions and thus fixes NoImplicitPrelude. It should also fix other similarly treated extensions such as NoMonomorphismRestriction

I have:

  • Based work on latest develop branch
  • Looked for lint in my changes with hlint . (lint found code you did not write can be left alone)
  • Run the test suite: $(nix-build -A selftest --no-out-link)
  • (Optional) Run CI tests locally: nix-build release.nix -A build.x86_64-linux --no-out-link (or x86_64-darwin on macOS)

@ali-abrar ali-abrar merged commit 8d03ddd into obsidiansystems:develop Nov 11, 2020
@ali-abrar
Copy link
Member

Thanks @rprije

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants