Skip to content

Avoid printing expanded names when displaying type parameters. #892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 31, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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