70fcce7bf57c4ee0c4d432cde10517d9a9ad3d80
[ghc.git] / testsuite / tests / typecheck / should_compile / tc237.hs
1 {-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
2 {-# LANGUAGE RankNTypes, MultiParamTypeClasses, FunctionalDependencies #-}
3
4 -- This one caught a bug in the implementation of functional
5 -- dependencies, where improvement must happen when
6 -- checking the call in 'test4'
7
8 module ShouldCompile where
9
10 newtype M s a = M a
11
12 class Modular s a | s -> a
13
14 wim :: forall a w. Integral a
15 => a -> (forall s. Modular s a => M s w) -> w
16 wim i k = error "urk"
17
18 test4' :: (Modular s a, Integral a) => M s a
19 test4' = error "urk"
20
21 test4 = wim 4 test4'