Test Trac #13271
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 22 Feb 2017 08:43:58 +0000 (08:43 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Wed, 22 Feb 2017 08:43:58 +0000 (08:43 +0000)
testsuite/tests/indexed-types/should_fail/T13271.hs [new file with mode: 0644]
testsuite/tests/indexed-types/should_fail/T13271.stderr [new file with mode: 0644]
testsuite/tests/indexed-types/should_fail/all.T

diff --git a/testsuite/tests/indexed-types/should_fail/T13271.hs b/testsuite/tests/indexed-types/should_fail/T13271.hs
new file mode 100644 (file)
index 0000000..3c72d2c
--- /dev/null
@@ -0,0 +1,13 @@
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE TypeFamilyDependencies #-}
+
+module T13271 where
+
+import GHC.TypeLits
+
+data T1 = T1
+type T2 = TypeError (Text "You can't do that!")
+
+type family X i = r | r -> i where
+  X 1 = T1
+  X 2 = T2
diff --git a/testsuite/tests/indexed-types/should_fail/T13271.stderr b/testsuite/tests/indexed-types/should_fail/T13271.stderr
new file mode 100644 (file)
index 0000000..e28dcea
--- /dev/null
@@ -0,0 +1,4 @@
+
+T13271.hs:9:1: error:
+    • You can't do that!
+    • In the type synonym declaration for ‘T2’
index 7f23c34..0645601 100644 (file)
@@ -130,3 +130,4 @@ test('T12522a', normal, compile_fail, [''])
 test('T12867', normal, compile_fail, [''])
 test('T7102', [ expect_broken(7102) ], ghci_script, ['T7102.script'])
 test('T7102a', normal, ghci_script, ['T7102a.script'])
+test('T13271', normal, compile_fail, [''])