diff options
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/typecheck/should_compile/T21519.hs | 18 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/T21519a.hs | 15 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/all.T | 2 |
3 files changed, 35 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T21519.hs b/testsuite/tests/typecheck/should_compile/T21519.hs new file mode 100644 index 0000000000..aa88fefb91 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T21519.hs @@ -0,0 +1,18 @@ +{-# LANGUAGE MagicHash, UnboxedTuples #-} + +module T21519 where + +import GHC.Exts + +(# #) = (# #) + +g1 :: Bool -> (# Int #) +g1 = g1 + +f1 x = let (# a #) = g1 True in a + +g2 :: Bool -> (# #) +g2 = g2 + +f2 x = let (# #) = g2 True in True + diff --git a/testsuite/tests/typecheck/should_compile/T21519a.hs b/testsuite/tests/typecheck/should_compile/T21519a.hs new file mode 100644 index 0000000000..04a1d629e0 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T21519a.hs @@ -0,0 +1,15 @@ +{-# LANGUAGE UnliftedDatatypes, UnliftedNewtypes, MagicHash #-} +module T21519a where + +import GHC.Exts + +type T :: UnliftedType +data T = MkT Int +MkT _ = MkT 10 -- (1) + +f x = let MkT _ = MkT 10 in True + +newtype T2 = MkT2 Int# +MkT2 _ = MkT2 10# -- (2) + +g x = let MkT2 _ = MkT2 10# in True diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 1764ccb34b..4f546c0914 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -825,3 +825,5 @@ test('T21205', normal, compile, ['-O0']) test('T21323', normal, compile, ['']) test('T21315', normal, compile, ['-Wredundant-constraints']) test('T21516', normal, compile, ['']) +test('T21519', normal, compile, ['']) +test('T21519a', normal, compile, ['']) |