summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2009-06-05 11:43:16 +0000
committerIan Lynagh <igloo@earth.li>2009-06-05 11:43:16 +0000
commitd49e38db67eaefa9c53356a9193c7a1e13a9b8f9 (patch)
tree03a9ec38877d775d80ab19460cbf8730ded37c44 /compiler
parentdb61aebd5ebfb37f434cc8d8a30e1a5c10375002 (diff)
downloadhaskell-d49e38db67eaefa9c53356a9193c7a1e13a9b8f9.tar.gz
Make a proper Opt_WarnLazyUnliftedBindings warning, with a flag etc
Diffstat (limited to 'compiler')
-rw-r--r--compiler/main/DynFlags.hs4
-rw-r--r--compiler/typecheck/TcBinds.lhs4
2 files changed, 7 insertions, 1 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index d3887c1fbd..d8b2e784a5 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -191,6 +191,7 @@ data DynFlag
| Opt_WarnTabs
| Opt_WarnUnrecognisedPragmas
| Opt_WarnDodgyForeignImports
+ | Opt_WarnLazyUnliftedBindings
-- language opts
| Opt_OverlappingInstances
@@ -906,6 +907,7 @@ standardWarnings
Opt_WarnMissingFields,
Opt_WarnMissingMethods,
Opt_WarnDuplicateExports,
+ Opt_WarnLazyUnliftedBindings,
Opt_WarnDodgyForeignImports
]
@@ -1659,6 +1661,8 @@ fFlags = [
( "warn-orphans", Opt_WarnOrphans, const Supported ),
( "warn-tabs", Opt_WarnTabs, const Supported ),
( "warn-unrecognised-pragmas", Opt_WarnUnrecognisedPragmas, const Supported ),
+ ( "warn-lazy-unlifted-bindings", Opt_WarnLazyUnliftedBindings,
+ const $ Deprecated "lazy unlifted bindings will be an error in GHC 6.14, and this flag will no longer exist"),
( "print-explicit-foralls", Opt_PrintExplicitForalls, const Supported ),
( "strictness", Opt_Strictness, const Supported ),
( "static-argument-transformation", Opt_StaticArgumentTransformation, const Supported ),
diff --git a/compiler/typecheck/TcBinds.lhs b/compiler/typecheck/TcBinds.lhs
index 4fd3ae0c89..18c61917c2 100644
--- a/compiler/typecheck/TcBinds.lhs
+++ b/compiler/typecheck/TcBinds.lhs
@@ -478,7 +478,8 @@ checkStrictBinds top_lvl rec_group mbind mono_tys infos
-- This should be a checkTc, not a warnTc, but as of GHC 6.11
-- the versions of alex and happy available have non-conforming
-- templates, so the GHC build fails if it's an error:
- ; warnTc (not bang_pat)
+ ; warnUnlifted <- doptM Opt_WarnLazyUnliftedBindings
+ ; warnTc (warnUnlifted && not bang_pat)
(unliftedMustBeBang mbind)
; mapM_ check_sig infos
; return True }
@@ -495,6 +496,7 @@ unliftedMustBeBang :: LHsBindsLR Var Var -> SDoc
unliftedMustBeBang mbind
= hang (text "Bindings containing unlifted types must use an outermost bang pattern:")
4 (pprLHsBinds mbind)
+ $$ text "*** This will be an error in GHC 6.14! Fix your code now!"
strictBindErr :: String -> Bool -> LHsBindsLR Var Var -> SDoc
strictBindErr flavour unlifted mbind