diff options
author | Richard Eisenberg <eir@cis.upenn.edu> | 2014-11-24 15:17:15 -0500 |
---|---|---|
committer | Richard Eisenberg <eir@cis.upenn.edu> | 2014-11-24 15:26:29 -0500 |
commit | 8459404b6431e44669f8732b6787c7d6b67b984b (patch) | |
tree | 2631e4a42de57bd25ac3a555986890b3ec0ee8f3 | |
parent | 63d2adaef999258d874a760591e9c9ec3d75aeaf (diff) | |
download | haskell-8459404b6431e44669f8732b6787c7d6b67b984b.tar.gz |
Test #8044 in typecheck/should_fail/T8044
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T8044.hs | 16 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T8044.stderr | 9 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/all.T | 1 |
3 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T8044.hs b/testsuite/tests/typecheck/should_fail/T8044.hs new file mode 100644 index 0000000000..0a1ce69bc9 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T8044.hs @@ -0,0 +1,16 @@ +{-# LANGUAGE GADTs, TypeFamilies #-} + +module T8044 where + +data X a where + XInt :: X Int + XBool :: X Bool + XChar :: X Char + +type family Frob a where + Frob Int = Int + Frob x = Char + +frob :: X a -> X (Frob a) +frob XInt = XInt +frob _ = XChar diff --git a/testsuite/tests/typecheck/should_fail/T8044.stderr b/testsuite/tests/typecheck/should_fail/T8044.stderr new file mode 100644 index 0000000000..6178ea3d47 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T8044.stderr @@ -0,0 +1,9 @@ + +T8044.hs:16:13: + Couldn't match type ‘Frob a’ with ‘Char’ + Expected type: X (Frob a) + Actual type: X Char + Relevant bindings include + frob :: X a -> X (Frob a) (bound at T8044.hs:15:1) + In the expression: XChar + In an equation for ‘frob’: frob _ = XChar diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 81ea3d25b9..05f77bbf99 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -344,3 +344,4 @@ test('T9318', normal, compile_fail, ['']) test('T9201', normal, compile_fail, ['']) test('T9109', normal, compile_fail, ['']) test('T9497d', normal, compile_fail, ['-fdefer-type-errors -fno-defer-typed-holes']) +test('T8044', normal, compile_fail, ['']) |