diff options
Diffstat (limited to 'compiler/GHC')
-rw-r--r-- | compiler/GHC/Prelude.hs | 8 | ||||
-rw-r--r-- | compiler/GHC/SysTools/Process.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Utils/Panic.hs | 3 |
3 files changed, 7 insertions, 6 deletions
diff --git a/compiler/GHC/Prelude.hs b/compiler/GHC/Prelude.hs index 46c5d3ee32..11d83b12c2 100644 --- a/compiler/GHC/Prelude.hs +++ b/compiler/GHC/Prelude.hs @@ -46,7 +46,7 @@ NoImplicitPrelude. There are two motivations for this: import Prelude as X hiding ((<>)) import Data.Foldable as X (foldl') #if __GLASGOW_HASKELL__ < 903 -import Control.Exception ( Exception, SomeException(..) ) +import Control.Exception ( SomeException(..) ) #else import Control.Exception ( SomeExceptionWithLocation(..) ) #endif @@ -104,8 +104,8 @@ shiftR = Bits.unsafeShiftR type SomeExceptionWithLocation = SomeException {-# COMPLETE SomeExceptionWithLocation #-} -pattern SomeExceptionWithLocation :: forall. forall a. Exception a => a -> () -> SomeException -pattern SomeExceptionWithLocation e unit <- (\x -> ((), x) -> (unit, SomeException e)) +pattern SomeExceptionWithLocation :: forall. SomeException -> () -> SomeException +pattern SomeExceptionWithLocation e unit <- (\x -> ((), x) -> (unit, e)) where - SomeExceptionWithLocation e _ = SomeException e + SomeExceptionWithLocation (SomeException e) _ = SomeException e #endif diff --git a/compiler/GHC/SysTools/Process.hs b/compiler/GHC/SysTools/Process.hs index d697b92af7..7a219c9aad 100644 --- a/compiler/GHC/SysTools/Process.hs +++ b/compiler/GHC/SysTools/Process.hs @@ -281,7 +281,7 @@ builderMainLoop logger filter_fn pgm real_args mb_cwd mb_env = do inner hProcess case r of -- onException - Left (SomeExceptionWithLocation e _) -> do + Left (SomeExceptionWithLocation (SomeException e) _) -> do terminateProcess hProcess cleanup_handles throw e diff --git a/compiler/GHC/Utils/Panic.hs b/compiler/GHC/Utils/Panic.hs index 673ee55d77..ab8bc837f7 100644 --- a/compiler/GHC/Utils/Panic.hs +++ b/compiler/GHC/Utils/Panic.hs @@ -110,7 +110,8 @@ data GhcException | PprProgramError String SDoc instance Exception GhcException where - fromException (SomeExceptionWithLocation e _) + -- TODO: Print stack traces here + fromException (SomeExceptionWithLocation (SomeException e) _) | Just ge <- cast e = Just ge | Just pge <- cast e = Just $ case pge of |