diff options
author | Thomas Miedema <thomasmiedema@gmail.com> | 2015-07-28 00:15:51 +0200 |
---|---|---|
committer | Thomas Miedema <thomasmiedema@gmail.com> | 2015-07-30 22:53:15 +0200 |
commit | 58986c4953b045247cb09caa544981cccf14f242 (patch) | |
tree | 00de80333145b2052d562376376e91340c577f75 | |
parent | 58b5f04483258e55b93390fbf5ce41a1dbe23340 (diff) | |
download | haskell-58986c4953b045247cb09caa544981cccf14f242.tar.gz |
Testsuite: add typecheck/should_fail/T8034 (#8034)
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T8034.hs | 6 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T8034.stderr | 12 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/all.T | 1 |
3 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T8034.hs b/testsuite/tests/typecheck/should_fail/T8034.hs new file mode 100644 index 0000000000..e432152e08 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T8034.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE TypeFamilies #-} +module T8034 where + +class C a where + type F a + foo :: F a -> F a diff --git a/testsuite/tests/typecheck/should_fail/T8034.stderr b/testsuite/tests/typecheck/should_fail/T8034.stderr new file mode 100644 index 0000000000..cea9dbc18c --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T8034.stderr @@ -0,0 +1,12 @@ + +T8034.hs:6:3: error: + Couldn't match type ‘F a0’ with ‘F a’ + NB: ‘F’ is a type function, and may not be injective + The type variable ‘a0’ is ambiguous + Expected type: F a -> F a + Actual type: F a0 -> F a0 + In the ambiguity check for the type signature for ‘foo’: + foo :: forall a. C a => F a -> F a + To defer the ambiguity check to use sites, enable AllowAmbiguousTypes + When checking the class method: foo :: forall a. C a => F a -> F a + In the class declaration for ‘C’ diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 3fdc38b559..1a2ff9aa81 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -315,6 +315,7 @@ test('T7869', normal, compile_fail, ['']) test('T7892', normal, compile_fail, ['']) test('T7809', normal, compile_fail, ['']) test('T7989', normal, compile_fail, ['']) +test('T8034', normal, compile_fail, ['']) test('T8142', normal, compile_fail, ['']) test('T8262', normal, compile_fail, ['']) test('TcCoercibleFail', when(compiler_lt('ghc', '7.7'), skip), compile_fail, ['']) |