Commit d1bc75c8 authored by Ian Lynagh's avatar Ian Lynagh

Use a bang pattern when we where/let-bind values with unlifted types

parent e9b2dc50
......@@ -19,5 +19,5 @@ main = putStr (case len4_twice of
_ -> "oops\n")
where
list4 = mk 4#
len4 = clen list4
len4_twice = len4 +# len4
!len4 = clen list4
!len4_twice = len4 +# len4
......@@ -10,4 +10,4 @@ f# a# = (# '\0'#, a# #)
g :: Int -> (Char, Int)
g (I# a#) = ( C# c#, I# b# )
where (# c#, b# #) = f# a#
where !(# c#, b# #) = f# a#
......@@ -18,7 +18,7 @@ test('print016', normal, ghci_script, ['print016.script'])
test('print017', normal, ghci_script, ['print017.script'])
test('print018', normal, ghci_script, ['print018.script'])
test('print019', normal, ghci_script, ['print019.script'])
test('print020', normal, ghci_script, ['print020.script'])
test('print020', expect_broken(2806), ghci_script, ['print020.script'])
test('print021', normal, ghci_script, ['print021.script'])
test('print022', normal, ghci_script, ['print022.script'])
test('print023', normal, ghci_script, ['print023.script'])
......
......@@ -5,4 +5,4 @@ import GHC.Base
f :: Int -> Int# -> Int#
f x i = i
test = let I# i = 3 in I#(f 2 i)
\ No newline at end of file
test = let !(I# i) = 3 in I# (f 2 i)
\ No newline at end of file
Stopped at dynbrk009.hs:8:18
Stopped at dynbrk009.hs:8:21
_result :: Int = _
Stopped at dynbrk009.hs:8:23-31
Stopped at dynbrk009.hs:8:26-35
_result :: Int = _
Stopped at dynbrk009.hs:8:26-30
Stopped at dynbrk009.hs:8:30-34
_result :: Int = _
Stopped at dynbrk009.hs:6:0-8
_result :: Int = _
......
......@@ -8,7 +8,7 @@ import GHC.Exts
f ixs@(_, ix_end) frozen# =
let
n# =
!n# =
case (
if null (range ixs)
then 0
......
......@@ -5,4 +5,4 @@
module Bug where
import GHC.Base
foo v = let I# x# = 7 * 7 in "Forty-Two"
\ No newline at end of file
foo v = let !(I# x#) = 7 * 7 in "Forty-Two"
\ No newline at end of file
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