Commit d157f5f2 authored by Jan Stolarek's avatar Jan Stolarek

Add regression test for #8142

parent 0bc0e7d3
{-# LANGUAGE TypeFamilies #-}
module T8142 where
tracer :: (Functor f, Coinductive f) => (c -> f c) -> (c -> f c)
tracer = h where h = (\(_, b) -> ((outI . fmap h) b)) . out
class Functor g => Coinductive g where
type Nu g :: *
out :: Nu g -> g (Nu g)
outI :: g (Nu g) -> Nu g
T8142.hs:6:18:
Couldn't match type ‛Nu f0’ with ‛Nu f’
NB: ‛Nu’ is a type function, and may not be injective
The type variable ‛f0’ is ambiguous
Expected type: a -> Nu f
Actual type: a -> Nu f0
When checking that ‛h’
has the inferred type ‛forall (f :: * -> *) a. a -> Nu f’
Probable cause: the inferred type is ambiguous
In an equation for ‛tracer’:
tracer
= h
where
h = (\ (_, b) -> ((outI . fmap h) b)) . out
T8142.hs:6:57:
Occurs check: cannot construct the infinite type: a ~ f1 a
Expected type: a -> (t0, f1 a)
Actual type: Nu ((,) t0) -> (t0, Nu ((,) t0))
Relevant bindings include h :: a -> Nu f1 (bound at T8142.hs:6:18)
In the second argument of ‛(.)’, namely ‛out’
In the expression: (\ (_, b) -> ((outI . fmap h) b)) . out
test('tcfail001', normal, compile_fail, [''])
test('tcfail002', normal, compile_fail, [''])
test('tcfail003', normal, compile_fail, [''])
......@@ -217,7 +217,7 @@ test('T3950', normal, compile_fail, [''])
test('T3966', normal, compile_fail, ['-O'])
test('IPFail', normal, compile_fail, [''])
test('T3468', extra_clean(['T3468.hi-boot', 'T3468.o-boot']),
test('T3468', extra_clean(['T3468.hi-boot', 'T3468.o-boot']),
multimod_compile_fail, ['T3468', '-v0'])
test('T2846b', normal, compile_fail, [''])
test('FrozenErrorTests', normal, compile_fail, [''])
......@@ -311,3 +311,4 @@ test('T7869', normal, compile_fail, [''])
test('T7892', normal, compile_fail, [''])
test('T7809', normal, compile_fail, [''])
test('T7989', normal, compile_fail, [''])
test('T8142', normal, 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