Ticket #4371: panic.hs

File panic.hs, 230 bytes (added by mafo, 4 years ago)

produce a ghc panic

Line 
1{-# LANGUAGE ViewPatterns,DeriveDataTypeable #-}
2import Data.Typeable
3
4data E1 = E1 deriving Typeable
5data E2 = E2 deriving Typeable
6
7f :: Typeable a => a-> ()
8f x = case x of
9  (cast -> Just E1) -> ()
10  (cast -> Just E2) -> ()
11