X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypecheck%2FTcRnTypes.lhs;h=50a5c55c1bb32a9e89a159b7312f0a114ab546aa;hb=dd6fe03634149bfb79aa1878114514806161947b;hp=9dd435173c88ef6e38863af17d2f7a7fed0962c7;hpb=19108ede05d6528d0b66edb2bcf031e8da9522e2;p=ghc-hetmet.git diff --git a/ghc/compiler/typecheck/TcRnTypes.lhs b/ghc/compiler/typecheck/TcRnTypes.lhs index 9dd4351..50a5c55 100644 --- a/ghc/compiler/typecheck/TcRnTypes.lhs +++ b/ghc/compiler/typecheck/TcRnTypes.lhs @@ -75,10 +75,11 @@ import Outputable import DATA_IOREF ( IORef, newIORef, readIORef, writeIORef ) import UNSAFE_IO ( unsafeInterleaveIO ) import FIX_IO ( fixIO ) -import EXCEPTION ( Exception(..), tryJust ) +import EXCEPTION ( Exception(..) ) import IO ( isUserError ) import Maybe ( mapMaybe ) import ListSetOps ( unionLists ) +import Panic ( tryJust ) \end{code} @@ -160,10 +161,12 @@ tryM :: TcRn m r -> TcRn m (Either Exception r) -- Reflect exception into TcRn monad tryM (TcRn thing) = TcRn (\ env -> tryJust tc_errors (thing env)) where -#if __GLASGOW_HASKELL__ > 504 +#if __GLASGOW_HASKELL__ > 504 || __GLASGOW_HASKELL__ < 500 tc_errors e@(IOException ioe) | isUserError ioe = Just e -#else - tc_errors e@(IOException _) | isUserError e = Just e +#elif __GLASGOW_HASKELL__ == 502 + tc_errors e@(UserError _) = Just e +#else + tc_errors e@(IOException ioe) | isUserError e = Just e #endif tc_errors _other = Nothing -- type checker failures show up as UserErrors only