aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/printing/RefinedPrinter.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-09-25 17:04:22 +0200
committerMartin Odersky <odersky@gmail.com>2016-09-25 17:04:22 +0200
commit80cbe114cc5d641d66512c58402eca4ae69f9f2a (patch)
treec2d137266a0ae6c59e44e15f959f0ca070ec0b7c /src/dotty/tools/dotc/printing/RefinedPrinter.scala
parent2d908c792fcf4287b4cb493f0e51dfbdb106cf69 (diff)
downloaddotty-80cbe114cc5d641d66512c58402eca4ae69f9f2a.tar.gz
dotty-80cbe114cc5d641d66512c58402eca4ae69f9f2a.tar.bz2
dotty-80cbe114cc5d641d66512c58402eca4ae69f9f2a.zip
Get rid of SelectFromType tree node.
Roll its functionality into Select. Since we can always tell whether a tree is a type or term there is no expressiveness gained by having a separate tree node.
Diffstat (limited to 'src/dotty/tools/dotc/printing/RefinedPrinter.scala')
-rw-r--r--src/dotty/tools/dotc/printing/RefinedPrinter.scala5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/printing/RefinedPrinter.scala b/src/dotty/tools/dotc/printing/RefinedPrinter.scala
index cbe48409c..1125f5f01 100644
--- a/src/dotty/tools/dotc/printing/RefinedPrinter.scala
+++ b/src/dotty/tools/dotc/printing/RefinedPrinter.scala
@@ -281,7 +281,8 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
case _ => toText(name)
}
case tree @ Select(qual, name) =>
- toTextLocal(qual) ~ ("." ~ nameIdText(tree) provided name != nme.CONSTRUCTOR)
+ if (qual.isType) toTextLocal(qual) ~ "#" ~ toText(name)
+ else toTextLocal(qual) ~ ("." ~ nameIdText(tree) provided name != nme.CONSTRUCTOR)
case tree: This =>
optDotPrefix(tree) ~ "this" ~ idText(tree)
case Super(qual: This, mix) =>
@@ -349,8 +350,6 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
if (tree.hasType) toText(tree.typeOpt) else toText(orig)
case SingletonTypeTree(ref) =>
toTextLocal(ref) ~ ".type"
- case SelectFromTypeTree(qual, name) =>
- toTextLocal(qual) ~ "#" ~ toText(name)
case AndTypeTree(l, r) =>
changePrec(AndPrec) { toText(l) ~ " & " ~ toText(r) }
case OrTypeTree(l, r) =>