aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala23
1 files changed, 10 insertions, 13 deletions
diff --git a/compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala b/compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala
index d5014b547..375edc3cb 100644
--- a/compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala
+++ b/compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala
@@ -97,11 +97,7 @@ class PlainPrinter(_ctx: Context) extends Printer {
|| (sym.name == nme.PACKAGE) // package
)
- def nameString(name: Name): String = name.toString + {
- if (ctx.settings.debugNames.value)
- if (name.isTypeName) "/T" else "/V"
- else ""
- }
+ def nameString(name: Name): String = name.toString
def toText(name: Name): Text = Str(nameString(name))
@@ -134,9 +130,8 @@ class PlainPrinter(_ctx: Context) extends Printer {
case tp: TypeType =>
toTextRHS(tp)
case tp: TermRef
- if !tp.denotationIsCurrent && !homogenizedView || // always print underyling when testing picklers
- tp.symbol.is(Module) ||
- tp.symbol.name.isImportName =>
+ if !tp.denotationIsCurrent && !homogenizedView || // always print underlying when testing picklers
+ tp.symbol.is(Module) || tp.symbol.name == nme.IMPORT =>
toTextRef(tp) ~ ".type"
case tp: TermRef if tp.denot.isOverloaded =>
"<overloaded " ~ toTextRef(tp) ~ ">"
@@ -183,7 +178,9 @@ class PlainPrinter(_ctx: Context) extends Printer {
toTextGlobal(tp.resultType)
}
case tp: TypeParamRef =>
- TypeParamRefNameString(tp) ~ lambdaHash(tp.binder)
+ ParamRefNameString(tp) ~ lambdaHash(tp.binder)
+ case tp: TermParamRef =>
+ ParamRefNameString(tp) ~ ".type"
case AnnotatedType(tpe, annot) =>
toTextLocal(tpe) ~ " " ~ toText(annot)
case HKApply(tycon, args) =>
@@ -206,10 +203,10 @@ class PlainPrinter(_ctx: Context) extends Printer {
}
}.close
- protected def TypeParamRefNameString(name: TypeName): String = name.toString
+ protected def ParamRefNameString(name: Name): String = name.toString
- protected def TypeParamRefNameString(param: TypeParamRef): String =
- TypeParamRefNameString(param.binder.paramNames(param.paramNum))
+ protected def ParamRefNameString(param: ParamRef): String =
+ ParamRefNameString(param.binder.paramNames(param.paramNum))
/** The name of the symbol without a unique id. Under refined printing,
* the decoded original name.
@@ -266,7 +263,7 @@ class PlainPrinter(_ctx: Context) extends Printer {
if (idx >= 0) selfRecName(idx + 1)
else "{...}.this" // TODO move underlying type to an addendum, e.g. ... z3 ... where z3: ...
case tp: SkolemType =>
- if (homogenizedView) toText(tp.info) else tp.repr
+ if (homogenizedView) toText(tp.info) else toText(tp.repr)
}
}