diff options
author | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2021-11-21 22:32:29 +0100 |
---|---|---|
committer | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2021-11-22 15:03:49 +0100 |
commit | 2c2912cd576cbc579f03d1973aa4410272086fbe (patch) | |
tree | 765313e4004cc83d05260a4098f918403fd87cd4 /compiler/GHC/Driver/Session.hs | |
parent | 742d8b6049c30f3b0cd1704d7a34d865bef41712 (diff) | |
download | haskell-wip/T20485.tar.gz |
Add a warning for GADT match + NoMonoLocalBinds (#20485)wip/T20485
Previously, it was an error to pattern match on a GADT
without GADTs or TypeFamilies.
This is now allowed. Instead, we check the flag MonoLocalBinds;
if it is not enabled, we issue a warning, controlled by -Wgadt-mono-local-binds.
Also fixes #20485: pattern synonyms are now checked too.
Diffstat (limited to 'compiler/GHC/Driver/Session.hs')
-rw-r--r-- | compiler/GHC/Driver/Session.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs index 5f4479939a..92149c96f4 100644 --- a/compiler/GHC/Driver/Session.hs +++ b/compiler/GHC/Driver/Session.hs @@ -3219,7 +3219,8 @@ wWarningFlagsDeps = mconcat [ warnSpec Opt_WarnImplicitLift, warnSpec Opt_WarnMissingExportedPatternSynonymSignatures, warnSpec Opt_WarnForallIdentifier, - warnSpec Opt_WarnUnicodeBidirectionalFormatCharacters + warnSpec Opt_WarnUnicodeBidirectionalFormatCharacters, + warnSpec Opt_WarnGADTMonoLocalBinds ] -- | These @-\<blah\>@ flags can all be reversed with @-no-\<blah\>@ |