summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/lib/OldException/OldException001.hs
blob: 150dc2aba75830f1a61b76990dbd1a66066f3624 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

-- trace #2913

{-# LANGUAGE DeriveDataTypeable #-}

import qualified Control.Exception as New
import qualified Control.OldException as Old

import Data.Typeable

data MyException = MyException
    deriving (Eq, Show, Typeable)

instance New.Exception MyException

main :: IO ()
main = (New.throwIO MyException
            `Old.catch`
            (\e -> do putStrLn ("Old got " ++ show e)
                      Old.throw e)
       ) `New.catch` (\e -> putStrLn ("New got " ++ show (e :: MyException)))