diff options
author | Tito Sacchi <tito.sakki@gmail.com> | 2021-08-18 14:11:34 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-09-17 09:36:31 -0400 |
commit | 6a7ae5edb21444804e9b2ac71018925745bea0b8 (patch) | |
tree | 532274a4f13492d9b9708539412510d0287a6646 /compiler/GHC/Driver/Session.hs | |
parent | 4564f00fdeb5e072e8f91fec72a6393f0e3f0703 (diff) | |
download | haskell-6a7ae5edb21444804e9b2ac71018925745bea0b8.tar.gz |
Emit warning if bang is applied to unlifted types
GHC will trigger a warning similar to the following when a strictness
flag is applied to an unlifted type (primitive or defined with the
Unlifted* extensions) in the definition of a data constructor.
Test.hs:7:13: warning: [-Wredundant-strictness-flags]
• Strictness flag has no effect on unlifted type ‘Int#’
• In the definition of data constructor ‘TestCon’
In the data type declaration for ‘Test’
|
7 | data Test = TestCon !Int#
| ^^^^^^^^^^^^^
Fixes #20187
Diffstat (limited to 'compiler/GHC/Driver/Session.hs')
-rw-r--r-- | compiler/GHC/Driver/Session.hs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs index 33c0fbe4cc..9c64535c77 100644 --- a/compiler/GHC/Driver/Session.hs +++ b/compiler/GHC/Driver/Session.hs @@ -3222,6 +3222,7 @@ wWarningFlagsDeps = mconcat [ warnSpec Opt_WarnUnusedRecordWildcards, warnSpec Opt_WarnRedundantBangPatterns, warnSpec Opt_WarnRedundantRecordWildcards, + warnSpec Opt_WarnRedundantStrictnessFlags, warnSpec Opt_WarnWrongDoBind, warnSpec Opt_WarnMissingPatternSynonymSignatures, warnSpec Opt_WarnMissingDerivingStrategies, |