From 8c94e9cefce1a4c7f8d35c566770aab6908c993d Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sat, 17 Aug 2013 09:20:47 -0700 Subject: Add some logging to instantiateTypeVar. This method is right at the center of ALL KINDS of bad. "this is quite nasty" begins the comment, and I credit its deadpan understatement. A little logging is the least we can offer the next guy. --- src/compiler/scala/tools/nsc/typechecker/Infer.scala | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala index c8377fde95..a7c43361fa 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala @@ -1199,6 +1199,17 @@ trait Infer extends Checkable { val tparam = tvar.origin.typeSymbol val TypeBounds(lo0, hi0) = tparam.info.bounds val tb @ TypeBounds(lo1, hi1) = instBounds(tvar) + val enclCase = context.enclosingCaseDef + + log("\n" + sm""" + |----- + | enclCase: ${enclCase.tree} + | saved: ${enclCase.savedTypeBounds} + | tparam: ${tparam.shortSymbolClass} + | def_s: ${tparam.defString} + | seen_s: ${tparam.defStringSeenAs(tb)} + |----- + """.trim) if (lo1 <:< hi1) { if (lo1 <:< lo0 && hi0 <:< hi1) // bounds unimproved @@ -1206,7 +1217,7 @@ trait Infer extends Checkable { else if (tparam == lo1.typeSymbolDirect || tparam == hi1.typeSymbolDirect) log(s"cyclical bounds: discarding TypeBounds($lo1, $hi1) for $tparam because $tparam appears as bounds") else { - context.enclosingCaseDef pushTypeBounds tparam + enclCase pushTypeBounds tparam tparam setInfo logResult(s"updated bounds: $tparam from ${tparam.info} to")(tb) } } -- cgit v1.2.3