summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZubin Duggal <zubin.duggal@gmail.com>2021-05-25 15:27:26 +0530
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-05-29 05:06:32 -0400
commit492b2dc53f3d0d61d78a31a749aa8b364bebb891 (patch)
tree05212dc543da5fe525339c9bfd1accdb1680ceaa
parent10f48e2296a171dd3e8ad5df47dce67c25317b95 (diff)
downloadhaskell-492b2dc53f3d0d61d78a31a749aa8b364bebb891.tar.gz
Fix Note [Positioning of forkM]
-rw-r--r--compiler/GHC/IfaceToCore.hs9
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/GHC/IfaceToCore.hs b/compiler/GHC/IfaceToCore.hs
index bf40b2947c..e72c931ae6 100644
--- a/compiler/GHC/IfaceToCore.hs
+++ b/compiler/GHC/IfaceToCore.hs
@@ -1302,11 +1302,10 @@ tcIfaceCompleteMatch (IfaceCompleteMatch ms mtc) = forkM doc $ do -- See Note [P
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We need to be lazy when type checking the interface, since these functions are
called when the interface itself is being loaded, which means it is not in the
-PIT yet. If we are not lazy enough, in certain cases we might recursively try to
-load the same interface in an infinite loop.
-
-For this reason, the forkM should be around as much of the computation as
-possible.
+PIT yet. In particular, the `tcIfaceTCon` must be inside the forkM, otherwise
+we'll try to look it up the TyCon, find it's not there, and so initiate the
+process (again) of loading the (very same) interface file. Result: infinite
+loop. See #19744.
-}
{-