Skip to content

Commit

Permalink
Avoid printing expanded names when displaying type parameters.
Browse files Browse the repository at this point in the history
Differences can be observed when checking neg/variances.scala.
Review and any necessary polishing by @smarter.
  • Loading branch information
odersky committed Oct 30, 2015
1 parent edfb6e7 commit 4cda3ff
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/dotty/tools/dotc/printing/RefinedPrinter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {

override def nameString(name: Name): String = name.decode.toString

override protected def simpleNameString(sym: Symbol): String =
sym.name.decode.toString
override protected def simpleNameString(sym: Symbol): String = {
val name = sym.originalName
nameString(if (sym is ExpandedTypeParam) name.asTypeName.unexpandedName else name)
}

override protected def fullNameOwner(sym: Symbol) = {
val owner = super.fullNameOwner(sym)
Expand Down Expand Up @@ -86,10 +88,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
else {
val tsym = tp.parent.member(tp.refinedName).symbol
if (!tsym.exists) super.refinementNameString(tp)
else {
val name = tsym.originalName
nameString(if (tsym is ExpandedTypeParam) name.asTypeName.unexpandedName else name)
}
else simpleNameString(tsym)
}

override def toText(tp: Type): Text = controlled {
Expand Down

0 comments on commit 4cda3ff

Please sign in to comment.