summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCsongor Kiss <kiss.csongor.kiss@gmail.com>2016-03-16 15:26:59 -0400
committerRichard Eisenberg <eir@cis.upenn.edu>2016-03-17 10:07:22 -0400
commitc5ed41cbcaa40068763c8bd01badcada38cdbd03 (patch)
treee03fbe5e17251b238ccf7c960d8a6ed3534f80e5
parentb5565f1a79fd24fc45a6f1a58821a317852d4b89 (diff)
downloadhaskell-c5ed41cbcaa40068763c8bd01badcada38cdbd03.tar.gz
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
-rw-r--r--compiler/typecheck/TcHsType.hs7
1 files changed, 5 insertions, 2 deletions
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 []