Commit 58986c49 authored by thomie's avatar thomie
Browse files

Testsuite: add typecheck/should_fail/T8034 (#8034)

parent 58b5f044
{-# LANGUAGE TypeFamilies #-}
module T8034 where
class C a where
type F a
foo :: F a -> F a
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’
......@@ -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, [''])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment