Commit 7f23a5df authored by Austin Seipp's avatar Austin Seipp
Browse files

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: default avatarAustin Seipp <austin@well-typed.com>
parent 0481e076
......@@ -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,
......
......@@ -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
......
......@@ -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>
......
......@@ -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>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment