From c5ed41cbcaa40068763c8bd01badcada38cdbd03 Mon Sep 17 00:00:00 2001 From: Csongor Kiss Date: Wed, 16 Mar 2016 15:26:59 -0400 Subject: 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 --- compiler/typecheck/TcHsType.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'compiler') diff --git a/compiler/typecheck/TcHsType.hs b/compiler/typecheck/TcHsType.hs index f931073ae1..37a867590a 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 [] -- cgit v1.2.1