7e52d3ce54e35ebccd742724ba1acd4072053d1f
[ghc.git] / testsuite / tests / typecheck / should_run / tcrun026.hs
1 {-# LANGUAGE Rank2Types #-}
2
3 -- Crashed GHC 5.04 with tcTyC
4 -- panic: tcSplitTyConApp forall x{-r6S-} :: *.
5 -- Main.L{-rr-} x{-r6S-}
6
7 -- GHC 6.3: this is now an error (can do subsumption in patterns)
8
9 module Main where
10
11 newtype FA c = FA (forall x . c x)
12 newtype L x = L [x]
13
14 my_nil = FA (L []) :: FA L
15
16 sample :: String
17 sample = case my_nil of FA (L x) -> "foo"++x
18
19 -- -- but this works fine
20 -- sample = case my_nil of FA x -> case x of L y -> "foo"++y
21
22 main = print sample