Improve error messages around kind mismatches.
[ghc.git] / testsuite / tests / typecheck / should_fail / FailDueToGivenOverlapping.hs
1 {-# LANGUAGE FlexibleContexts #-}
2
3 module FailDueToGivenOverlapping where
4
5 class C a where
6
7 class D a where
8 dop :: a -> ()
9
10
11 instance C a => D [a]
12
13 -- should succeed since we can't learn anything more for 'a'
14 foo :: (C a, D [Int]) => a -> ()
15 foo x = dop [x]
16
17
18 class E a where
19 eop :: a -> ()
20
21 instance E [a] where
22 eop = undefined
23
24 -- should fail since we can never be sure that we learnt
25 -- everything about the free unification variable.
26 bar :: E [Int] => () -> ()
27 bar _ = eop [undefined]