summaryrefslogtreecommitdiff
path: root/compiler/utils/FastFunctions.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2017-05-04 13:33:04 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2017-05-04 17:27:08 +0100
commite77019767fe5327011c6dc8fe089c64884120aab (patch)
treee043abc315addd6560cfac01d88699fa11db5685 /compiler/utils/FastFunctions.hs
parent81af480a0fd3b37fff17245c1468638597261bcb (diff)
downloadhaskell-e77019767fe5327011c6dc8fe089c64884120aab.tar.gz
Deal with exceptions in dsWhenNoErrs
Gracious me. Ever since this patch commit 374457809de343f409fbeea0a885877947a133a2 Author: Jan Stolarek <jan.stolarek@p.lodz.pl> Date: Fri Jul 11 13:54:45 2014 +0200 Injective type families TcRnMonad.askNoErrs has been wrong. It looked like this askNoErrs :: TcRn a -> TcRn (a, Bool) askNoErrs m = do { errs_var <- newTcRef emptyMessages ; res <- setErrsVar errs_var m ; (warns, errs) <- readTcRef errs_var ; addMessages (warns, errs) ; return (res, isEmptyBag errs) } The trouble comes if 'm' throws an exception in the TcRn monad. Then 'errs_var is never read, so any errors are simply lost. This mistake was then propgated into DsMonad.dsWhenNoErrs, where it gave rise to Trac #13642. Thank to Ryan for narrowing it down so sharply. I did some refactoring, as usual.
Diffstat (limited to 'compiler/utils/FastFunctions.hs')
0 files changed, 0 insertions, 0 deletions