Andreas Klebinger pushed to branch wip/andreask/9.10.4-batch1 at Glasgow Haskell Compiler / GHC

Commits:

1 changed file:

Changes:

  • libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs
    ... ... @@ -224,8 +224,10 @@ instance Show a => Show (ExceptionWithContext a) where
    224 224
     
    
    225 225
     instance Exception a => Exception (ExceptionWithContext a) where
    
    226 226
         toException (ExceptionWithContext ctxt e) =
    
    227
    -        SomeException e
    
    228
    -      where ?exceptionContext = ctxt
    
    227
    +        case toException e of
    
    228
    +          SomeException c ->
    
    229
    +            let ?exceptionContext = ctxt
    
    230
    +            in SomeException c
    
    229 231
         fromException se = do
    
    230 232
             e <- fromException se
    
    231 233
             return (ExceptionWithContext (someExceptionContext se) e)