[Git][ghc/ghc][wip/andreask/9.10.4-batch1] Fix toException method for ExceptionWithContext
Andreas Klebinger pushed to branch wip/andreask/9.10.4-batch1 at Glasgow Haskell Compiler / GHC Commits: ffcaf0ff by Matthew Pickering at 2026-05-21T09:41:54+02:00 Fix toException method for ExceptionWithContext Fixes #25235 (cherry picked from commit 9bfd9fd0730359b4e88e97b08d3654d966a9a11d) - - - - - 1 changed file: - libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs Changes: ===================================== libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs ===================================== @@ -224,8 +224,10 @@ instance Show a => Show (ExceptionWithContext a) where instance Exception a => Exception (ExceptionWithContext a) where toException (ExceptionWithContext ctxt e) = - SomeException e - where ?exceptionContext = ctxt + case toException e of + SomeException c -> + let ?exceptionContext = ctxt + in SomeException c fromException se = do e <- fromException se return (ExceptionWithContext (someExceptionContext se) e) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ffcaf0ffd4226ddd68597fe1334fb9ac... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ffcaf0ffd4226ddd68597fe1334fb9ac... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Andreas Klebinger (@AndreasK)