[Git][ghc/ghc][master] Add regression test for #23549
Marge Bot (@marge-bot)
gitlab at gitlab.haskell.org
Mon Jul 3 07:31:19 UTC 2023
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
0e09c38e by Ryan Hendrickson at 2023-07-03T03:30:56-04:00
Add regression test for #23549
- - - - -
4 changed files:
- + testsuite/tests/unlifted-datatypes/should_run/T23549.hs
- + testsuite/tests/unlifted-datatypes/should_run/T23549.stdout
- + testsuite/tests/unlifted-datatypes/should_run/T23549a.hs
- testsuite/tests/unlifted-datatypes/should_run/all.T
Changes:
=====================================
testsuite/tests/unlifted-datatypes/should_run/T23549.hs
=====================================
@@ -0,0 +1,23 @@
+{-# LANGUAGE GADTs, TypeData, TypeFamilies #-}
+module Main where
+
+import GHC.Types (Type)
+
+import T23549a
+
+type data TDWrapper = TDWrapperCon Type
+
+type family UnwrapTDW tdw where
+ UnwrapTDW (TDWrapperCon a) = a
+
+data ProxyBox tdw = ProxyBox (UnliftedGADTProxy (UnwrapTDW tdw))
+
+shouldBeExhaustive :: ProxyBox (TDWrapperCon Int) -> ()
+shouldBeExhaustive pb = id $ case pb of ProxyBox UGPInt -> ()
+
+main :: IO ()
+main = let
+ pb :: ProxyBox (TDWrapperCon Int)
+ pb = ProxyBox UGPInt
+ !_ = shouldBeExhaustive pb
+ in putStrLn "OK"
=====================================
testsuite/tests/unlifted-datatypes/should_run/T23549.stdout
=====================================
@@ -0,0 +1 @@
+OK
=====================================
testsuite/tests/unlifted-datatypes/should_run/T23549a.hs
=====================================
@@ -0,0 +1,9 @@
+{-# LANGUAGE GADTs, UnliftedDatatypes #-}
+module T23549a where
+
+import GHC.Exts (UnliftedType)
+import GHC.Types (Type)
+
+data UnliftedGADTProxy :: Type -> UnliftedType where
+ UGPInt :: UnliftedGADTProxy Int
+ UGPBool :: UnliftedGADTProxy Bool
=====================================
testsuite/tests/unlifted-datatypes/should_run/all.T
=====================================
@@ -1,2 +1,3 @@
test('UnlData1', normal, compile_and_run, [''])
test('UnlGadt1', [exit_code(1), expect_broken_for(23060, ghci_ways)], compile_and_run, [''])
+test('T23549', normal, multimod_compile_and_run, ['T23549', ''])
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0e09c38e133e6c46889408d7ff1b2c56e7df5782
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0e09c38e133e6c46889408d7ff1b2c56e7df5782
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230703/84ef935b/attachment-0001.html>
More information about the ghc-commits
mailing list