Commit 806d823e authored by archblob's avatar archblob Committed by Austin Seipp
Browse files

Correct checkStrictBinds for generalised type



See Trac #9140.

Auditors: simonpj
Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
parent defc42e7
......@@ -1454,8 +1454,8 @@ checkStrictBinds top_lvl rec_group orig_binds tc_binds poly_ids
any_strict_pat = any (isStrictHsBind . unLoc) orig_binds
any_pat_looks_lazy = any (looksLazyPatBind . unLoc) orig_binds
is_unlifted id = case tcSplitForAllTys (idType id) of
(_, rho) -> isUnLiftedType rho
is_unlifted id = case tcSplitSigmaTy (idType id) of
(_, _, rho) -> isUnLiftedType rho
is_monomorphic (L _ (AbsBinds { abs_tvs = tvs, abs_ev_vars = evs }))
= null tvs && null evs
......
:set -XUnboxedTuples -XBangPatterns
let a = (# 1 #)
let a = (# 1, 3 #)
:set -XBangPatterns
let !a = (# 1, 3 #)
<interactive>:3:5:
You can't mix polymorphic and unlifted bindings
a = (# 1 #)
Probable fix: use a bang pattern
<interactive>:4:5:
You can't mix polymorphic and unlifted bindings
a = (# 1, 3 #)
Probable fix: use a bang pattern
Top level:
GHCi can't bind a variable of unlifted type:
a :: (# Integer, Integer #)
......@@ -177,3 +177,4 @@ test('T8959', normal, ghci_script, ['T8959.script'])
test('T8959b', expect_broken(8959), ghci_script, ['T8959b.script'])
test('T9181', normal, ghci_script, ['T9181.script'])
test('T9086b', normal, ghci_script, ['T9086b.script'])
test('T9140', combined_output, ghci_script, ['T9140.script'])
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