Commit 535ad9d0 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Test Trac #6123, and improve an error message in T2627b

parent 77066aca
Occurs check: cannot construct the infinite type:
b0 = Dual (Dual b0)
In the expression: conn undefined undefined
Couldn't match expected type `b0' with actual type `Dual (Dual b0)'
`b0' is untouchable
inside the constraints (b ~ W a2 b2)
bound at a pattern with constructor
Wr :: forall a b. a -> Comm b -> Comm (W a b),
in an equation for `conn'
In the pattern: Wr a r
In an equation for `conn':
conn (Rd k) (Wr a r) = conn undefined undefined
{-# LANGUAGE TypeFamilies #-}
module T6123 where
type family Id a
cid :: a ~ Id a => a -> a
cid x = x
cundefined = cid undefined
Couldn't match expected type `a0' with actual type `Id a0'
The type variable `a0' is ambiguous
Possible cause: the monomorphism restriction applied to the following:
cundefined :: a0 (bound at T6123.hs:10:1)
Probable fix: give these definition(s) an explicit type signature
or use -XNoMonomorphismRestriction
In the expression: cid undefined
In an equation for `cundefined': cundefined = cid undefined
......@@ -73,6 +73,6 @@ test('T1897b', normal, compile_fail, [''])
test('T5439', normal, compile_fail, [''])
test('T5515', normal, compile_fail, [''])
test('T5763', expect_broken(5673), compile_fail, [''])
test('T5934', normal, compile_fail, [''])
test('T6123', 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