Commit 2d96883e authored by Simon Peyton Jones's avatar Simon Peyton Jones

Test Trac #2544

parent 4ea571a6
{-# LANGUAGE TypeOperators, TypeFamilies #-}
module T2544 where
data (:|:) a b = Inl a | Inr b
class Ix i where
type IxMap i :: * -> *
empty :: IxMap i [Int]
data BiApp a b c = BiApp (a c) (b c)
instance (Ix l, Ix r) => Ix (l :|: r) where
type IxMap (l :|: r) = BiApp (IxMap l) (IxMap r)
empty = BiApp empty empty
\ No newline at end of file
T2544.hs:15:12:
Could not deduce (IxMap l ~ IxMap i0)
from the context (Ix l, Ix r)
bound by the instance declaration at T2544.hs:13:10-37
NB: `IxMap' is a type function, and may not be injective
Expected type: IxMap (l :|: r) [Int]
Actual type: BiApp (IxMap i0) (IxMap r) [Int]
In the return type of a call of `BiApp'
In the expression: BiApp empty empty
In an equation for `empty': empty = BiApp empty empty
T2544.hs:15:24:
Could not deduce (IxMap i1 ~ IxMap r)
from the context (Ix l, Ix r)
bound by the instance declaration at T2544.hs:13:10-37
NB: `IxMap' is a type function, and may not be injective
Expected type: IxMap r [Int]
Actual type: IxMap i1 [Int]
In the second argument of `BiApp', namely `empty'
In the expression: BiApp empty empty
In an equation for `empty': empty = BiApp empty empty
......@@ -68,4 +68,5 @@ test('T4174', normal, compile_fail, [''])
test('DerivUnsatFam', if_compiler_lt('ghc', '7.1', expect_fail), compile_fail, [''])
test('T2664', normal, compile_fail, [''])
test('T2664a', normal, compile, [''])
test('T2544', 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