diff options
author | Richard Eisenberg <eir@cis.upenn.edu> | 2014-11-18 13:16:01 -0500 |
---|---|---|
committer | Richard Eisenberg <eir@cis.upenn.edu> | 2014-11-20 15:27:28 -0500 |
commit | 5eebd990ea7a5bc1937657b101ae83475e20fc7a (patch) | |
tree | 19e6805bfbf41c342dda0ef4638386efd0af6943 | |
parent | 786b62aa57e4dcc528e2da2f7d0451ab834d655a (diff) | |
download | haskell-5eebd990ea7a5bc1937657b101ae83475e20fc7a.tar.gz |
Test #9318 in typecheck/should_fail/T9318
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T9318.hs | 12 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T9318.stderr | 7 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/all.T | 1 |
3 files changed, 20 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T9318.hs b/testsuite/tests/typecheck/should_fail/T9318.hs new file mode 100644 index 0000000000..3110305318 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T9318.hs @@ -0,0 +1,12 @@ +{-# LANGUAGE TypeFamilies #-} + +module T9318 where + +type family F x +type instance F Int = Bool + +foo :: F Int -> () +foo True = () + +bar :: F Int -> () +bar 'x' = () diff --git a/testsuite/tests/typecheck/should_fail/T9318.stderr b/testsuite/tests/typecheck/should_fail/T9318.stderr new file mode 100644 index 0000000000..963d73e1fe --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T9318.stderr @@ -0,0 +1,7 @@ + +T9318.hs:12:5: + Couldn't match type ‘Bool’ with ‘Char’ + Expected type: F Int + Actual type: Char + In the pattern: 'x' + In an equation for ‘bar’: bar 'x' = () diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 2b128dc004..b6b5572ac4 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -342,3 +342,4 @@ test('T9612', normal, compile_fail, ['']) test('T9634', normal, compile_fail, ['']) test('T9739', normal, compile_fail, ['']) test('T9774', normal, compile_fail, ['']) +test('T9318', normal, compile_fail, ['']) |