summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2017-02-22 11:19:49 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2017-02-22 11:19:49 +0000
commitfed7136c597868d1c13b96837a2b64137a9ee65c (patch)
tree0183e631388c02f55125cfb9d465f524fd937474 /testsuite/tests
parent484f8d35b7cb3f77d96f9f4ffc16bb8c946f47fd (diff)
downloadhaskell-fed7136c597868d1c13b96837a2b64137a9ee65c.tar.gz
Test Trac #13244
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/indexed-types/should_compile/T13244.hs34
-rw-r--r--testsuite/tests/indexed-types/should_compile/all.T1
2 files changed, 35 insertions, 0 deletions
diff --git a/testsuite/tests/indexed-types/should_compile/T13244.hs b/testsuite/tests/indexed-types/should_compile/T13244.hs
new file mode 100644
index 0000000000..e1a65b99ef
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_compile/T13244.hs
@@ -0,0 +1,34 @@
+{-# LANGUAGE MagicHash, DataKinds, PolyKinds, TypeInType, TypeFamilies #-}
+
+module T13244 where
+
+import Data.Int
+import Data.Word
+import GHC.Prim
+import GHC.Types
+
+type family Rep x where
+ Rep Int = IntRep
+ Rep Int8 = IntRep
+ Rep Int16 = IntRep
+ Rep Int32 = IntRep
+ Rep Int64 = Int64Rep
+ Rep Bool = IntRep
+ Rep Char = IntRep
+ Rep Word = WordRep
+ Rep Word8 = WordRep
+ Rep Word16 = WordRep
+ Rep Word32 = WordRep
+ Rep Word64 = Word64Rep
+ Rep Float = FloatRep
+ Rep Double = DoubleRep
+
+class Unbox x where
+ type Unboxed x :: TYPE (Rep x)
+ unbox :: x -> Unboxed x
+ box :: Unboxed x -> x
+
+instance Unbox Int where
+ type Unboxed Int = Int#
+ unbox (I# i) = i
+ box = I#
diff --git a/testsuite/tests/indexed-types/should_compile/all.T b/testsuite/tests/indexed-types/should_compile/all.T
index 26e24ada34..cdce0f66e6 100644
--- a/testsuite/tests/indexed-types/should_compile/all.T
+++ b/testsuite/tests/indexed-types/should_compile/all.T
@@ -260,3 +260,4 @@ test('T12522b', normal, compile, [''])
test('T12676', normal, compile, [''])
test('T12526', normal, compile, [''])
test('T12538', normal, compile_fail, [''])
+test('T13244', normal, compile, [''])