Don't prematurely force TyThing thunks with -ddump-if-trace.
authorEdward Z. Yang <ezyang@cs.stanford.edu>
Tue, 10 May 2016 07:14:05 +0000 (00:14 -0700)
committerEdward Z. Yang <ezyang@cs.stanford.edu>
Thu, 12 May 2016 02:55:31 +0000 (19:55 -0700)
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate

Reviewers: simonpj, austin, bgamari

Subscribers: thomie

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

compiler/iface/TcIface.hs

index 25fa227..9a4a5c7 100644 (file)
@@ -144,7 +144,10 @@ typecheckIface iface
 
                 -- Finished
         ; traceIf (vcat [text "Finished typechecking interface for" <+> ppr (mi_module iface),
-                         text "Type envt:" <+> ppr type_env])
+                         -- Careful! If we tug on the TyThing thunks too early
+                         -- we'll infinite loop with hs-boot.  See #10083 for
+                         -- an example where this would cause non-termination.
+                         text "Type envt:" <+> ppr (map fst names_w_things)])
         ; return $ ModDetails { md_types     = type_env
                               , md_insts     = insts
                               , md_fam_insts = fam_insts