Remove the type-checking knot.
[ghc.git] / testsuite / tests / polykinds / T13371.hs
1 {-# LANGUAGE
2 MonoLocalBinds,
3 PolyKinds,
4
5 FunctionalDependencies,
6 FlexibleContexts #-}
7
8 -- reduced version of
9 -- http://code.haskell.org/~aavogt/HList_dredge_ghc802/Data/HList/Dredge.hs
10 --
11 -- F ~ EnsureLabel
12 -- g_f ~ dredge
13 -- g_f' ~ dredge'
14
15 {- ghc-8.0.2
16
17 too_eager.hs:25:14: warning: [-Wdeferred-type-errors]
18 • No instance for (F t0 (Proxy b0)) arising from a use of ‘g_f’
19 • In the first argument of ‘id’, namely ‘(g_f a)’
20 In the expression: id (g_f a)
21 In an equation for ‘g_f'’: g_f' a = id (g_f a)
22
23
24 ghc-7.10.3 can wait to select the instance for F
25
26 -}
27
28 module T13371 where
29
30 import Data.Proxy
31
32 class F a b | a -> b where
33 f :: a -> b
34
35 g :: Proxy b -> c
36 g _ = undefined
37
38 -- a type signature (what ghc infers) makes it work
39 -- g_f :: F a (Proxy b) => a -> c
40 g_f a = g (f a)
41
42 g_f' a = id (g_f a)