summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/T18998.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck/should_compile/T18998.hs')
-rw-r--r--testsuite/tests/typecheck/should_compile/T18998.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T18998.hs b/testsuite/tests/typecheck/should_compile/T18998.hs
new file mode 100644
index 0000000000..25571bae30
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T18998.hs
@@ -0,0 +1,14 @@
+{-# LANGUAGE LinearTypes, GADTs, DataKinds, KindSignatures #-}
+
+-- this caused a TcLevel assertion failure
+
+module T18998 where
+
+import GHC.Types
+import GHC.TypeLits
+
+data Id :: Nat -> Type -> Type where
+ MkId :: a %1-> Id 0 a
+
+f :: a %1-> Id n a -> Id n a
+f a (MkId _) = MkId a