[commit: ghc] master: Add a test for Trac #10806 (487c90e)

git at git.haskell.org git at git.haskell.org
Fri Sep 11 16:17:16 UTC 2015


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/487c90edd3c36406bdc020afd79a6696ae52c19b/ghc

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

commit 487c90edd3c36406bdc020afd79a6696ae52c19b
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Sep 11 15:55:29 2015 +0100

    Add a test for Trac #10806


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

487c90edd3c36406bdc020afd79a6696ae52c19b
 testsuite/tests/indexed-types/should_compile/T10806.hs     | 11 +++++++++++
 testsuite/tests/indexed-types/should_compile/T10806.stderr |  9 +++++++++
 testsuite/tests/indexed-types/should_compile/all.T         |  2 +-
 3 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/testsuite/tests/indexed-types/should_compile/T10806.hs b/testsuite/tests/indexed-types/should_compile/T10806.hs
new file mode 100644
index 0000000..149cd0f
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_compile/T10806.hs
@@ -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
index 0000000..3503105
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_compile/T10806.stderr
@@ -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'
diff --git a/testsuite/tests/indexed-types/should_compile/all.T b/testsuite/tests/indexed-types/should_compile/all.T
index 7bbb04b..5e7e468 100644
--- a/testsuite/tests/indexed-types/should_compile/all.T
+++ b/testsuite/tests/indexed-types/should_compile/all.T
@@ -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, [''])



More information about the ghc-commits mailing list