summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZubin Duggal <zubin.duggal@gmail.com>2021-05-25 15:27:26 +0530
committerZubin <zubin.duggal@gmail.com>2021-05-27 15:57:27 -0400
commita20da71e8348aed90edf7df23f5d051d3c551df2 (patch)
tree7d3623ef0b86f8b06c2a5244c8a0ac39855e1f70
parentce1b8f4208530fe6449506ba22e3a05048f81564 (diff)
downloadhaskell-wip/19744-note.tar.gz
Fix Note [Positioning of forkM]wip/19744-note
-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.
-}
{-