summaryrefslogtreecommitdiff
path: root/testsuite/tests/indexed-types/should_fail/T2203a.hs
blob: 89ed37e3dadeab47052c74e6abaa773488068385 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{-# LANGUAGE ScopedTypeVariables, TypeFamilies, FlexibleInstances #-}

module T2203a where

class Foo a where
   type TheFoo a
   foo :: TheFoo a -> a
   foo' :: a -> Int

class Bar b where
   bar :: b -> Int

instance Foo a => Bar (Either a (TheFoo a)) where
   bar (Left a) = foo' a
   bar (Right b) = foo' (foo b :: a)