Skip to content

Commit 278d212

Browse files
committed
Some polishings in RefinedPrinter
- drop redundant test - avoid computing owner of NoSymbol
1 parent 4695364 commit 278d212

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,6 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
169169
}
170170

171171
homogenize(tp) match {
172-
case x: ConstantType if homogenizedView =>
173-
return toText(x.widen)
174172
case AppliedType(tycon, args) =>
175173
val cls = tycon.typeSymbol
176174
if (tycon.isRepeatedParam) return toTextLocal(args.head) ~ "*"
@@ -617,7 +615,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
617615
}
618616

619617
private def toTextOwner(tree: Tree[_]) =
620-
"[owner = " ~ tree.symbol.owner.show ~ "]" provided ctx.settings.YprintDebugOwners.value
618+
"[owner = " ~ tree.symbol.maybeOwner.show ~ "]" provided ctx.settings.YprintDebugOwners.value
621619

622620
protected def dclTextOr[T >: Untyped](tree: Tree[T])(treeText: => Text) =
623621
toTextOwner(tree) ~ {

0 commit comments

Comments
 (0)