Add a test for Trac #10806
authorSimon Peyton Jones <simonpj@microsoft.com>
Fri, 11 Sep 2015 14:55:29 +0000 (15:55 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Fri, 11 Sep 2015 16:03:16 +0000 (17:03 +0100)
testsuite/tests/indexed-types/should_compile/T10806.hs [new file with mode: 0644]
testsuite/tests/indexed-types/should_compile/T10806.stderr [new file with mode: 0644]
testsuite/tests/indexed-types/should_compile/all.T

diff --git a/testsuite/tests/indexed-types/should_compile/T10806.hs b/testsuite/tests/indexed-types/should_compile/T10806.hs
new file mode 100644 (file)
index 0000000..149cd0f
--- /dev/null
@@ -0,0 +1,11 @@
+{-# LANGUAGE GADTs, ExplicitNamespaces, TypeOperators, DataKinds  #-}
+
+module T10806 where
+
+import GHC.TypeLits (Nat, type (<=))
+
+data Q a where
+    Q :: (a <= b, b <= c) => proxy a -> proxy b -> Q c
+
+triggersLoop :: Q b -> Q b -> Bool
+triggersLoop (Q _ _) (Q _ _) = print 'x' 'y'
diff --git a/testsuite/tests/indexed-types/should_compile/T10806.stderr b/testsuite/tests/indexed-types/should_compile/T10806.stderr
new file mode 100644 (file)
index 0000000..3503105
--- /dev/null
@@ -0,0 +1,9 @@
+
+T10806.hs:11:32: error:
+    Couldn't match expected type ‘Char -> Bool’
+                with actual type ‘IO ()’
+    The function ‘print’ is applied to two arguments,
+    but its type ‘Char -> IO ()’ has only one
+    In the expression: print 'x' 'y'
+    In an equation for ‘triggersLoop’:
+        triggersLoop (Q _ _) (Q _ _) = print 'x' 'y'
index 7bbb04b..5e7e468 100644 (file)
@@ -262,4 +262,4 @@ test('T10507', normal, compile, [''])
 test('T10634', normal, compile, [''])
 test('T10713', normal, compile, [''])
 test('T10753', normal, compile, [''])
-
+test('T10806', normal, compile_fail, [''])