diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2015-09-11 15:55:29 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2015-09-11 17:03:16 +0100 |
commit | 487c90edd3c36406bdc020afd79a6696ae52c19b (patch) | |
tree | 6fdafb6d721bc87436dacb25f6c8faab975ce881 /testsuite/tests | |
parent | a870738a3b34d264c63656783e84168a230d7da4 (diff) | |
download | haskell-487c90edd3c36406bdc020afd79a6696ae52c19b.tar.gz |
Add a test for Trac #10806
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/indexed-types/should_compile/T10806.hs | 11 | ||||
-rw-r--r-- | testsuite/tests/indexed-types/should_compile/T10806.stderr | 9 | ||||
-rw-r--r-- | testsuite/tests/indexed-types/should_compile/all.T | 2 |
3 files changed, 21 insertions, 1 deletions
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 0000000000..149cd0f203 --- /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 0000000000..3503105498 --- /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 7bbb04b7fc..5e7e468766 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, ['']) |