[commit: ghc] master: typechecker: fix trac issue #11708 (c5ed41c)

git at git.haskell.org git at git.haskell.org
Thu Mar 17 14:05:20 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/c5ed41cbcaa40068763c8bd01badcada38cdbd03/ghc

>---------------------------------------------------------------

commit c5ed41cbcaa40068763c8bd01badcada38cdbd03
Author: Csongor Kiss <kiss.csongor.kiss at gmail.com>
Date:   Wed Mar 16 15:26:59 2016 -0400

    typechecker: fix trac issue #11708
    
    Summary: Fixes T11708
    
    Reviewers: austin, bgamari, goldfire, simonpj
    
    Reviewed By: goldfire, simonpj
    
    Subscribers: simonpj, goldfire, thomie
    
    Differential Revision: https://phabricator.haskell.org/D2006
    
    GHC Trac Issues: #11708


>---------------------------------------------------------------

c5ed41cbcaa40068763c8bd01badcada38cdbd03
 compiler/typecheck/TcHsType.hs | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/compiler/typecheck/TcHsType.hs b/compiler/typecheck/TcHsType.hs
index f931073..37a8675 100644
--- a/compiler/typecheck/TcHsType.hs
+++ b/compiler/typecheck/TcHsType.hs
@@ -938,8 +938,11 @@ tcTyVar mode name         -- Could be a tyvar, a tycon, or a datacon
 
       | otherwise
       = do { (tc_ty, kind) <- instantiateTyN 0 ty tc_kind
-           ; traceTc "tcTyVar2b" (vcat [ ppr tc <+> dcolon <+> ppr tc_kind
-                                       , ppr tc_ty $$ ppr kind ])
+           -- tc and tc_ty must not be traced here, because that would
+           -- force the evaluation of a potentially knot-tied variable (tc),
+           -- and the typechecker would hang, as per #11708
+           ; traceTc "tcTyVar2b" (vcat [ ppr tc_tc <+> dcolon <+> ppr tc_kind
+                                       , ppr kind ])
            ; return (tc_ty, kind) }
       where
         ty      = mkNakedTyConApp tc []



More information about the ghc-commits mailing list