Embrace -XTypeInType, add -XStarIsType
[ghc.git] / testsuite / tests / simplCore / should_run / T7924.hs
1 {-# LANGUAGE DeriveDataTypeable #-}
2 module Main where
3 import Control.Exception (throwIO, Exception)
4 import Control.Monad (when)
5 import Data.Typeable (Typeable)
6
7 data Boom = Boom deriving (Show, Typeable)
8 instance Exception Boom
9
10 main = do
11 args <- return []
12
13 -- Should throw this exception.
14 when (length args /= 1) (throwIO Boom)
15
16 -- With -O, instead throws this one from head [].
17 let n = read (head args)
18 print (n :: Int)
19
20 return ()