summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2016-01-22 13:33:36 +0100
committerBen Gamari <ben@smart-cactus.org>2016-01-23 22:50:07 +0100
commit89bdac7635e6ed08927d760aa885d3e7ef3edb81 (patch)
tree1af391d9bf39cd4defa2c5ed6fdbb380915e22d8
parent923d2151db261cac36577bcaffa6be41c3f374f9 (diff)
downloadhaskell-89bdac7635e6ed08927d760aa885d3e7ef3edb81.tar.gz
Add test for #11473
-rw-r--r--testsuite/tests/typecheck/should_fail/T11473.hs20
-rw-r--r--testsuite/tests/typecheck/should_fail/all.T1
2 files changed, 21 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T11473.hs b/testsuite/tests/typecheck/should_fail/T11473.hs
new file mode 100644
index 0000000000..cb9f79158a
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T11473.hs
@@ -0,0 +1,20 @@
+{-# LANGUAGE PolyKinds, TypeFamilies, MagicHash, DataKinds, TypeInType, RankNTypes #-}
+
+module T11473 where
+import GHC.Exts
+import GHC.Types
+
+type family Boxed (a :: k) :: *
+type instance Boxed Char# = Char
+type instance Boxed Char = Char
+
+class BoxIt (a :: TYPE lev) where
+ boxed :: a -> Boxed a
+
+instance BoxIt Char# where boxed x = C# x
+instance BoxIt Char where boxed = id
+
+-- This should be an error: there is no way we can produce code for both Lifted
+-- and Unlifted levities
+hello :: forall (lev :: Levity). forall (a :: TYPE lev). BoxIt a => a -> Boxed a
+hello x = boxed x
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index 1c4e86ec9b..3b090f72ca 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -404,3 +404,4 @@ test('T11347', normal, compile_fail, [''])
test('T11356', normal, compile_fail, [''])
test('T11355', normal, compile_fail, [''])
test('T11464', normal, compile_fail, [''])
+test('T11473', expect_broken(11473), compile_fail, [''])