summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-03-29 15:00:56 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2021-04-07 09:38:49 +0100
commit6d286cec8161396b56ee769bcee835c8eca0e181 (patch)
tree62b933afcbddee7a8fd9208f4c536bd8000d096c
parent5babf63a1574b11ba74227f990424b8fe856de1f (diff)
downloadhaskell-6d286cec8161396b56ee769bcee835c8eca0e181.tar.gz
Make updTcRef force the result
This can lead to a classic thunk build-up in a TcRef Fixes #19596
-rw-r--r--compiler/GHC/Tc/Utils/Monad.hs3
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/GHC/Tc/Utils/Monad.hs b/compiler/GHC/Tc/Utils/Monad.hs
index bddb585a51..fb613c8f8d 100644
--- a/compiler/GHC/Tc/Utils/Monad.hs
+++ b/compiler/GHC/Tc/Utils/Monad.hs
@@ -695,8 +695,7 @@ writeTcRef = writeMutVar
updTcRef :: TcRef a -> (a -> a) -> TcRnIf gbl lcl ()
-- Returns ()
-updTcRef ref fn = liftIO $ do { old <- readIORef ref
- ; writeIORef ref (fn old) }
+updTcRef ref fn = liftIO $ modifyIORef' ref fn
{-
************************************************************************