Commit 6a8e733a authored by Austin Seipp's avatar Austin Seipp

Fix fallout from making lazy unlifted bindings an error

Issue #8022Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
parent 883fd49f
{-# LANGUAGE CPP, MagicHash #-}
{-# LANGUAGE CPP, MagicHash, BangPatterns #-}
import Data.Char
import Data.Array
import GHC.Exts
......@@ -416,7 +416,7 @@ happyReduce k i fn 0# tk st sts stk
= happyFail 0# tk st sts stk
happyReduce k nt fn j tk st sts stk
= case happyDrop (k -# (1# :: Int#)) sts of
sts1@((HappyCons (st1@(action)) (_))) ->
!sts1@((HappyCons (st1@(action)) (_))) ->
let r = fn stk in -- it doesn't hurt to always seq here...
happyDoSeq r (happyGoto nt j tk st1 sts1 r)
......@@ -424,14 +424,14 @@ happyMonadReduce k nt fn 0# tk st sts stk
= happyFail 0# tk st sts stk
happyMonadReduce k nt fn j tk st sts stk =
happyThen1 (fn stk tk) (\r -> happyGoto nt j tk st1 sts1 (r `HappyStk` drop_stk))
where sts1@((HappyCons (st1@(action)) (_))) = happyDrop k (HappyCons (st) (sts))
where !sts1@((HappyCons (st1@(action)) (_))) = happyDrop k (HappyCons (st) (sts))
drop_stk = happyDropStk k stk
happyMonad2Reduce k nt fn 0# tk st sts stk
= happyFail 0# tk st sts stk
happyMonad2Reduce k nt fn j tk st sts stk =
happyThen1 (fn stk tk) (\r -> happyNewToken new_state sts1 (r `HappyStk` drop_stk))
where sts1@((HappyCons (st1@(action)) (_))) = happyDrop k (HappyCons (st) (sts))
where !sts1@((HappyCons (st1@(action)) (_))) = happyDrop k (HappyCons (st) (sts))
drop_stk = happyDropStk k stk
off = indexShortOffAddr happyGotoOffsets st1
......
GenericTemplate.hs:219:14: Warning:
Pattern bindings containing unlifted types should use an outermost bang pattern:
sts1@((HappyCons (st1@(action)) (_)))
= happyDrop k (HappyCons (st) (sts))
In an equation for ‛happyMonadReduce’:
happyMonadReduce k nt fn j tk st sts stk
= happyThen1
(fn stk tk)
(\ r -> happyGoto nt j tk st1 sts1 (r `HappyStk` drop_stk))
where
sts1@((HappyCons (st1@(action)) (_)))
= happyDrop k (HappyCons (st) (sts))
drop_stk = happyDropStk k stk
GenericTemplate.hs:226:14: Warning:
Pattern bindings containing unlifted types should use an outermost bang pattern:
sts1@((HappyCons (st1@(action)) (_)))
= happyDrop k (HappyCons (st) (sts))
In an equation for ‛happyMonad2Reduce’:
happyMonad2Reduce k nt fn j tk st sts stk
= happyThen1
(fn stk tk)
(\ r -> happyNewToken new_state sts1 (r `HappyStk` drop_stk))
where
sts1@((HappyCons (st1@(action)) (_)))
= happyDrop k (HappyCons (st) (sts))
drop_stk = happyDropStk k stk
off = indexShortOffAddr happyGotoOffsets st1
off_i = (off +# nt)
....
{-# LANGUAGE MagicHash #-}
{-# OPTIONS_GHC -Werror #-}
-- Trac #2806
......
T2806.hs:13:11: Warning:
T2806.hs:12:11:
Pattern bindings containing unlifted types should use an outermost bang pattern:
(I# _x) = 4
In an equation for ‛foo’:
......@@ -7,6 +7,3 @@ T2806.hs:13:11: Warning:
= 3
where
(I# _x) = 4
<no location info>:
Failing due to -Werror.
......@@ -189,7 +189,7 @@ test('tcfail199', normal, compile_fail, [''])
test('tcfail200', normal, compile_fail, [''])
test('tcfail201', normal, compile_fail, [''])
test('tcfail202', normal, compile_fail, [''])
test('tcfail203', normal, compile, [''])
test('tcfail203', normal, compile_fail, [''])
test('tcfail203a', normal, compile_fail, [''])
test('tcfail204', normal, compile_fail, [''])
test('tcfail206', normal, compile_fail, [''])
......
tcfail203.hs:28:11: Warning:
tcfail203.hs:28:11:
Pattern bindings containing unlifted types should use an outermost bang pattern:
(I# x) = 5
In an equation for ‛fail2’:
......@@ -8,7 +8,7 @@ tcfail203.hs:28:11: Warning:
where
(I# x) = 5
tcfail203.hs:31:11: Warning:
tcfail203.hs:31:11:
Pattern bindings containing unlifted types should use an outermost bang pattern:
(b, I# x) = (True, 5)
In an equation for ‛fail3’:
......@@ -17,7 +17,7 @@ tcfail203.hs:31:11: Warning:
where
(b, I# x) = (True, 5)
tcfail203.hs:40:11: Warning:
tcfail203.hs:40:11:
Pattern bindings containing unlifted types should use an outermost bang pattern:
(I# !x) = 5
In an equation for ‛fail6’:
......@@ -26,7 +26,7 @@ tcfail203.hs:40:11: Warning:
where
(I# !x) = 5
tcfail203.hs:43:11: Warning:
tcfail203.hs:43:11:
Pattern bindings containing unlifted types should use an outermost bang pattern:
(b, !(I# x)) = (True, 5)
In an equation for ‛fail7’:
......
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