Make interface loading for COMPLETE pragmas lazy
authorMatthew Pickering <matthewtpickering@gmail.com>
Thu, 2 Feb 2017 03:54:31 +0000 (22:54 -0500)
committerBen Gamari <ben@smart-cactus.org>
Thu, 2 Feb 2017 04:37:48 +0000 (23:37 -0500)
Without this additional laziness we will loop forever trying
to find the definitions of the conlikes referenced in the pragma.

Fixes #13188

Reviewers: austin, RyanGlScott, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D3058

GHC Trac Issues: #13188

compiler/iface/TcIface.hs

index f6a4f41..d2ddeb2 100644 (file)
@@ -1033,8 +1033,9 @@ tcIfaceCompleteSigs :: [IfaceCompleteMatch] -> IfL [CompleteMatch]
 tcIfaceCompleteSigs = mapM tcIfaceCompleteSig
 
 tcIfaceCompleteSig :: IfaceCompleteMatch -> IfL CompleteMatch
-tcIfaceCompleteSig (IfaceCompleteMatch ms t) =
-  CompleteMatch <$> (mapM tcIfaceConLike ms) <*> tcIfaceTyConByName t
+tcIfaceCompleteSig cm@(IfaceCompleteMatch ms t) =
+  forkM (text "COMPLETE" <+> ppr cm) $
+    CompleteMatch <$> mapM tcIfaceConLike ms <*> tcIfaceTyConByName t
 
 {-
 ************************************************************************