Commit 4a2bedfc authored by chak@cse.unsw.edu.au.'s avatar chak@cse.unsw.edu.au.
Browse files

TFs: Added T2203b

parent 39428d8e
{-# LANGUAGE ScopedTypeVariables, TypeFamilies #-}
module T2203b where
class Foo a where
type TheFoo a
foo :: TheFoo a -> a
foo' :: a -> Int
class Bar b where
bar :: b -> Int
instance (b ~ TheFoo a, Foo a) => Bar (Either a b) where
bar (Left a) = foo' a
bar (Right b) = foo' (foo b :: a)
instance Foo Int where
type TheFoo Int = Int
foo = id
foo' = id
val :: Either Int Int
val = Left 5
res :: Int
res = bar val
\ No newline at end of file
......@@ -128,3 +128,4 @@ test('T2639', normal, compile, [''])
test('T2944', normal, compile, [''])
test('T3017', if_compiler_lt('ghc', '6.11', expect_fail), compile, ['-ddump-types'])
test('TF_GADT', if_compiler_lt('ghc', '6.11', expect_fail), compile, [''])
test('T2203b', if_compiler_lt('ghc', '6.11', expect_fail), compile, [''])
Supports Markdown
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