summaryrefslogtreecommitdiff
path: root/testsuite/tests/stranal/should_compile/T19882b.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2021-05-27 12:02:45 +0100
committerBen Gamari <ben@smart-cactus.org>2021-06-04 15:11:16 -0400
commita32f41a14a3f2d3245e36033f44d326415428f37 (patch)
tree8acffaedb40069e6630e680c1d7e7bbe87ff6ca1 /testsuite/tests/stranal/should_compile/T19882b.hs
parent0f56e4c14a34d4f3e69652db9b2662b57eb6467a (diff)
downloadhaskell-a32f41a14a3f2d3245e36033f44d326415428f37.tar.gz
Re-do rubbish literals
As #19882 pointed out, we were simply doing rubbish literals wrong. (I'll refrain from explaining the wrong-ness here -- see the ticket.) This patch fixes it by adding a Type (of kind RuntimeRep) as field of LitRubbish, rather than [PrimRep]. The Note [Rubbish literals] in GHC.Types.Literal explains the details.
Diffstat (limited to 'testsuite/tests/stranal/should_compile/T19882b.hs')
-rw-r--r--testsuite/tests/stranal/should_compile/T19882b.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/testsuite/tests/stranal/should_compile/T19882b.hs b/testsuite/tests/stranal/should_compile/T19882b.hs
new file mode 100644
index 0000000000..455bd016c1
--- /dev/null
+++ b/testsuite/tests/stranal/should_compile/T19882b.hs
@@ -0,0 +1,9 @@
+{-# LANGUAGE UnboxedTuples, MagicHash #-}
+
+module T19882b where
+
+import GHC.Exts
+
+f2 :: (# State# RealWorld, Int #) -> Bool -> Int
+f2 x True = 1
+f2 x False = f2 x True