aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/printing/PlainPrinter.scala
diff options
context:
space:
mode:
authorodersky <odersky@gmail.com>2015-01-31 19:19:07 +0100
committerodersky <odersky@gmail.com>2015-01-31 19:19:07 +0100
commita822fc15235d9cc91302bd82d180830eff357ae2 (patch)
tree3bd15eecb77b1fca0b944ba5f203ba6f5c41a582 /src/dotty/tools/dotc/printing/PlainPrinter.scala
parent537c53b2eba195317f0e7f0ede0cf3fdbd80e790 (diff)
parent70e55d26100199b99502705233786bbdc15c4c6b (diff)
downloaddotty-a822fc15235d9cc91302bd82d180830eff357ae2.tar.gz
dotty-a822fc15235d9cc91302bd82d180830eff357ae2.tar.bz2
dotty-a822fc15235d9cc91302bd82d180830eff357ae2.zip
Merge pull request #331 from dotty-staging/fix/refined-subtyping
Fix/refined subtyping
Diffstat (limited to 'src/dotty/tools/dotc/printing/PlainPrinter.scala')
-rw-r--r--src/dotty/tools/dotc/printing/PlainPrinter.scala15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/printing/PlainPrinter.scala b/src/dotty/tools/dotc/printing/PlainPrinter.scala
index 166c2a7c4..f34135431 100644
--- a/src/dotty/tools/dotc/printing/PlainPrinter.scala
+++ b/src/dotty/tools/dotc/printing/PlainPrinter.scala
@@ -145,10 +145,10 @@ class PlainPrinter(_ctx: Context) extends Printer {
if (tp.isInstantiated)
toTextLocal(tp.instanceOpt) ~ "'" // debug for now, so that we can see where the TypeVars are.
else {
- val bounds = ctx.typerState.constraint.at(tp.origin) match {
- case bounds: TypeBounds => bounds
- case _ => TypeBounds.empty
- }
+ val constr = ctx.typerState.constraint
+ val bounds =
+ if (constr.contains(tp)) constr.fullBounds(tp.origin)
+ else TypeBounds.empty
"(" ~ toText(tp.origin) ~ "?" ~ toText(bounds) ~ ")"
}
case _ =>
@@ -207,8 +207,11 @@ class PlainPrinter(_ctx: Context) extends Printer {
toText(value)
case MethodParam(mt, idx) =>
nameString(mt.paramNames(idx))
- case RefinedThis(_) =>
- "this"
+ case sk: SkolemType =>
+ sk.binder match {
+ case rt: RefinedType => s"${nameString(rt.typeSymbol)}{...}.this"
+ case _ => "<skolem>"
+ }
}
}