[commit: ghc] master: Test Trac #12081 (853cdae)

git at git.haskell.org git at git.haskell.org
Mon Oct 24 16:37:37 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/853cdaea7f8724cd071f4fa7ad6c5377a2a8a6e4/ghc

>---------------------------------------------------------------

commit 853cdaea7f8724cd071f4fa7ad6c5377a2a8a6e4
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Mon Oct 24 17:37:16 2016 +0100

    Test Trac #12081


>---------------------------------------------------------------

853cdaea7f8724cd071f4fa7ad6c5377a2a8a6e4
 testsuite/tests/dependent/should_fail/T12081.hs     | 9 +++++++++
 testsuite/tests/dependent/should_fail/T12081.stderr | 7 +++++++
 testsuite/tests/dependent/should_fail/all.T         | 1 +
 3 files changed, 17 insertions(+)

diff --git a/testsuite/tests/dependent/should_fail/T12081.hs b/testsuite/tests/dependent/should_fail/T12081.hs
new file mode 100644
index 0000000..f68de42
--- /dev/null
+++ b/testsuite/tests/dependent/should_fail/T12081.hs
@@ -0,0 +1,9 @@
+{-# LANGUAGE TypeInType #-}
+
+module T12081 where
+
+data Nat = Z | S Nat
+
+class C (n :: Nat) where
+  type T n :: Nat
+  f :: (a :: T n)
diff --git a/testsuite/tests/dependent/should_fail/T12081.stderr b/testsuite/tests/dependent/should_fail/T12081.stderr
new file mode 100644
index 0000000..77d5a40
--- /dev/null
+++ b/testsuite/tests/dependent/should_fail/T12081.stderr
@@ -0,0 +1,7 @@
+
+T12081.hs:9:14: error:
+    • Type constructor ‘T’ cannot be used here
+        (it is defined and used in the same recursive group)
+    • In the kind ‘T n’
+      In the type signature: f :: (a :: T n)
+      In the class declaration for ‘C’
diff --git a/testsuite/tests/dependent/should_fail/all.T b/testsuite/tests/dependent/should_fail/all.T
index f1ed340..b9c82f1 100644
--- a/testsuite/tests/dependent/should_fail/all.T
+++ b/testsuite/tests/dependent/should_fail/all.T
@@ -15,3 +15,4 @@ test('KindLevelsB', normal, compile_fail, [''])
 test('T11473', normal, compile_fail, [''])
 test('T11471', normal, compile_fail, [''])
 test('T12174', normal, compile_fail, [''])
+test('T12081', normal, compile_fail, [''])



More information about the ghc-commits mailing list