summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Seipp <austin@well-typed.com>2013-09-09 21:50:52 -0500
committerAustin Seipp <austin@well-typed.com>2013-09-29 07:31:12 -0500
commit7f23a5dfd8ea061a25f13b1ecef799d834732668 (patch)
tree182991d1321efc8e7f9bda73f5d29f9633fb225d
parent0481e076f3cb4010894324cac71e947c6637805a (diff)
downloadhaskell-7f23a5dfd8ea061a25f13b1ecef799d834732668.tar.gz
Make lazy unlifted bindings an error by default.
This was supposed to happen a long time ago, but later is better than never. This makes `-fwarn-lazy-unlifted-bindings` into a no-op (with its own warning) to be removed in GHC 7.10. This fixes #8022. Signed-off-by: Austin Seipp <austin@well-typed.com>
-rw-r--r--compiler/main/DynFlags.hs4
-rw-r--r--compiler/typecheck/TcBinds.lhs10
-rw-r--r--docs/users_guide/flags.xml2
-rw-r--r--docs/users_guide/using.xml8
4 files changed, 9 insertions, 15 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index d6b386a475..40b8156319 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -2542,7 +2542,8 @@ fWarningFlags = [
( "warn-auto-orphans", Opt_WarnAutoOrphans, nop ),
( "warn-tabs", Opt_WarnTabs, nop ),
( "warn-unrecognised-pragmas", Opt_WarnUnrecognisedPragmas, nop ),
- ( "warn-lazy-unlifted-bindings", Opt_WarnLazyUnliftedBindings, nop ),
+ ( "warn-lazy-unlifted-bindings", Opt_WarnLazyUnliftedBindings,
+ \_ -> deprecate "it has no effect, and will be removed in GHC 7.10" ),
( "warn-unused-do-bind", Opt_WarnUnusedDoBind, nop ),
( "warn-wrong-do-bind", Opt_WarnWrongDoBind, nop ),
( "warn-alternative-layout-rule-transitional", Opt_WarnAlternativeLayoutRuleTransitional, nop ),
@@ -2961,7 +2962,6 @@ standardWarnings
Opt_WarnEmptyEnumerations,
Opt_WarnMissingFields,
Opt_WarnMissingMethods,
- Opt_WarnLazyUnliftedBindings,
Opt_WarnWrongDoBind,
Opt_WarnUnsupportedCallingConventions,
Opt_WarnDodgyForeignImports,
diff --git a/compiler/typecheck/TcBinds.lhs b/compiler/typecheck/TcBinds.lhs
index 532e6efd10..fced8ae53d 100644
--- a/compiler/typecheck/TcBinds.lhs
+++ b/compiler/typecheck/TcBinds.lhs
@@ -1345,11 +1345,11 @@ checkStrictBinds top_lvl rec_group orig_binds tc_binds poly_ids
; checkTc (isSingleton orig_binds)
(strictBindErr "Multiple" unlifted orig_binds)
- -- 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:
- ; warnUnlifted <- woptM Opt_WarnLazyUnliftedBindings
- ; warnTc (warnUnlifted && not bang_pat && lifted_pat)
+ -- Ensure that unlifted bindings which look lazy, like:
+ -- f x = let I# y = x
+ -- cause an error.
+ ; when lifted_pat $
+ checkTc bang_pat
-- No outer bang, but it's a compound pattern
-- E.g (I# x#) = blah
-- Warn about this, but not about
diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml
index cc40dfcb36..557b1d5c2e 100644
--- a/docs/users_guide/flags.xml
+++ b/docs/users_guide/flags.xml
@@ -1351,7 +1351,7 @@
<row>
<entry><option>-fwarn-lazy-unlifted-bindings</option></entry>
- <entry>warn when a pattern binding looks lazy but must be strict</entry>
+ <entry><emphasis>(deprecated)</emphasis> warn when a pattern binding looks lazy but must be strict</entry>
<entry>dynamic</entry>
<entry><option>-fno-warn-lazy-unlifted-bindings</option></entry>
</row>
diff --git a/docs/users_guide/using.xml b/docs/users_guide/using.xml
index 8ac2779b2d..5618a2a568 100644
--- a/docs/users_guide/using.xml
+++ b/docs/users_guide/using.xml
@@ -976,7 +976,6 @@ test.hs:(5,4)-(6,7):
<option>-fwarn-empty-enumerations</option>,
<option>-fwarn-missing-fields</option>,
<option>-fwarn-missing-methods</option>,
- <option>-fwarn-lazy-unlifted-bindings</option>,
<option>-fwarn-wrong-do-bind</option>,
<option>-fwarn-unsupported-calling-conventions</option>,
<option>-fwarn-dodgy-foreign-imports</option>,
@@ -1266,12 +1265,7 @@ foreign import "&amp;f" f :: FunPtr t
<listitem>
<indexterm><primary><option>-fwarn-lazy-unlifted-bindings</option></primary>
</indexterm>
- <para>Causes a warning to be emitted when an unlifted type
- is bound in a way that looks lazy, e.g.
- <literal>where (I# x) = ...</literal>. Use
- <literal>where !(I# x) = ...</literal> instead. This will be an
- error, rather than a warning, in GHC 7.2.
- </para>
+ <para>This flag is a no-op, and will be removed in GHC 7.10.</para>
</listitem>
</varlistentry>