Define TyCoRep.ppSuggestExplicitKinds, and use it
[ghc.git] / testsuite / tests / typecheck / should_fail / T7748a.hs
1 -- Correct type, which is inferred by GHC 7.6.1 and
2 -- works fine with GHC 7.6.2:
3 -- test :: Maybe (Maybe (r -> ())) -> r -> ()
4
5 -- Incorrect type, resulting in a runtime <<loop>>,
6 -- inferred by GHC 7.6.2 and also accepted by GHC 7.6.1:
7 -- test :: a -> r -> ()
8
9 module T7748a where
10
11 test :: a -> r -> ()
12 test zd
13 = let f = let g = case zd of
14 Nothing -> const ()
15 Just Nothing -> const ()
16 Just (Just p) -> p
17 in g
18 in f
19
20
21
22 {-
23 There is a bug in the type checker of 7.6.1 and 7.6.2, which accepts
24 an incorrect type resulting in <<loop>> at runtime. Furthermore, 7.6.2
25 even automatically infers this incorrect type. Hence, the attached
26 code has the following behavior:
27
28 - No explicit type: Code works in 7.6.1, loops in 7.6.2
29 - Correct explicit type: Code works fine in 7.6.1 and 7.6.2
30 - Incorrect explicit type: Code loops in 7.6.1 and 7.6.2
31
32 The incorrect type has a parameter that is too polymorphic, i.e. an
33 "a" type is accepted while the function does a pattern match on the
34 parameter from which it is clear that it should be a Maybe type. In
35 7.4.* versions this incorrect type is not accepted.
36 -}