Ben Gamari pushed to branch wip/T27456 at Glasgow Haskell Compiler / GHC

Commits:

2 changed files:

Changes:

  • changelog.d/T27456
    1
    +section: base
    
    2
    +issues: #27456
    
    3
    +mrs: !
    
    4
    +synopsis:
    
    5
    +  Show `ExceptionContext` in `displayExceptionAnnotation` implementation of `WhileHandling`
    
    6
    +description:
    
    7
    +  In the past ``displayException`` (in terms of which ``WhileHandling``\'s ``displayExceptionAnnotation` is implemented) was changed to hide ``ExceptionContext``. This regressed the behavior of ``displayExceptionAnnotation`` from that which was originally specified. Restore the intended behavior of showing the ``ExceptionContext`` of the carried exception.
    
    8
    +

  • libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs
    ... ... @@ -84,7 +84,7 @@ data WhileHandling = WhileHandling SomeException deriving Show
    84 84
     
    
    85 85
     instance ExceptionAnnotation WhileHandling where
    
    86 86
       displayExceptionAnnotation (WhileHandling e) =
    
    87
    -    "While handling " ++ case lines $ displayException e of
    
    87
    +    "While handling " ++ case lines $ displayExceptionWithInfo e of
    
    88 88
           [] -> ""
    
    89 89
           (l1:ls) ->
    
    90 90
             -- Indent lines forward.