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

Add -XTypeOperators #1713

Conversation

philderbeast
Copy link
Contributor

See #1681. Adds LANGUAGE TypeOperators where warned that this will be needed, such as:

$ cabal build all --enable-tests --enable-benchmarks
Resolving dependencies...
Build profile: -w ghc-9.4.7 -O0
...
src/Servant/Types/SourceT.hs:73:19: warning: [-Wtype-equality-requires-operators]
    The use of ‘~’ without TypeOperators
    will become an error in a future GHC release.
    Suggested fix: Perhaps you intended to use TypeOperators
   |
73 | instance Identity ~ m => Foldable (SourceT m) where
   |  

Can be tested by doing a rebuild from clean with this warning as an error:

$ git diff
diff --git a/cabal.project b/cabal.project
index 2239b77c..888f4689 100644
--- a/cabal.project
+++ b/cabal.project
@@ -77,3 +77,6 @@ if(impl(ghc >= 9.6.1))
 allow-newer: servant-multipart:servant, servant-multipart:servant-server, servant-multipart-api:servant
 allow-newer: servant-pagination:servant, servant-pagination:servant-server
 allow-newer: servant-js:servant, servant-js:servant-foreign
+
+program-options
+  ghc-options: -Werror=type-equality-requires-operators
\ No newline at end of file

Copy link
Contributor

@tchoutri tchoutri left a comment

Choose a reason for hiding this comment

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

Thank you!

@tchoutri tchoutri merged commit c60c312 into haskell-servant:master Nov 8, 2023
8 checks passed
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