Merge non-moving garbage collector
[ghc.git] / testsuite / tests / typecheck / should_compile / tc152.hs
1 {-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
2 {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies,
3 UndecidableInstances #-}
4 -- -XUndecidableInstances now needed because the Coverage Condition fails
5
6 -- This one blew up Hugs (Apr 02)
7
8 module ShouldCompile where
9
10 -- Context reduction can introduce opportunities for context improvement,
11 -- so add an additional `improve' step afterwards. The bug is demonstrated by
12 -- the following code:
13
14 class C a b c | a b -> c where
15 m :: a -> b -> c
16
17 instance C Integer Integer Integer where
18 m = error "urk"
19
20 newtype T a = T a
21
22 instance C a b c => C (T a) (T b) (T c) where
23 m = error "urk"
24
25 i :: T Integer
26 i = undefined
27
28 x = m (m i i) i -- This line blows up w/ unresolved top-level overloading
29