From d6d798a61150ecde9dddf48b9d79901ac309ee2b Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sun, 16 Nov 2014 12:50:17 +0100 Subject: [PATCH] When printing uninstantiated type variables, include their bounds. --- src/dotty/tools/dotc/printing/PlainPrinter.scala | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/dotty/tools/dotc/printing/PlainPrinter.scala b/src/dotty/tools/dotc/printing/PlainPrinter.scala index 1652dbbc0d1d..809f29924088 100644 --- a/src/dotty/tools/dotc/printing/PlainPrinter.scala +++ b/src/dotty/tools/dotc/printing/PlainPrinter.scala @@ -142,8 +142,11 @@ class PlainPrinter(_ctx: Context) extends Printer { case AnnotatedType(annot, tpe) => toTextLocal(tpe) ~ " " ~ toText(annot) case tp: TypeVar => - val suffix = if (tp.isInstantiated) "'" else "?" - toTextLocal(tp.instanceOpt orElse tp.origin) ~ suffix // debug for now, so that we can see where the TypeVars are. + if (tp.isInstantiated) + toTextLocal(tp.instanceOpt) ~ "'" // debug for now, so that we can see where the TypeVars are. + else + "(" ~ toText(tp.origin) ~ "?" ~ + toText(ctx.typerState.constraint.bounds(tp.origin)) ~ ")" case _ => tp.fallbackToText(this) }