Skip to content

Commit c277b98

Browse files
committed
Put proper parentheses around complex widened types of singletons.
In the type `(A & B)(C.this)`, the first parens were missing, so the type displayed as A & B(C.this), which is confusing.
1 parent 70f18eb commit c277b98

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/dotty/tools/dotc/printing/PlainPrinter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class PlainPrinter(_ctx: Context) extends Printer {
120120
case tp: TermRef if tp.denot.isOverloaded =>
121121
"<overloaded " ~ toTextRef(tp) ~ ">"
122122
case tp: SingletonType =>
123-
toText(tp.underlying) ~ "(" ~ toTextRef(tp) ~ ")"
123+
toTextLocal(tp.underlying) ~ "(" ~ toTextRef(tp) ~ ")"
124124
case tp: TypeRef =>
125125
toTextPrefix(tp.prefix) ~ selectionString(tp)
126126
case tp: RefinedType =>

0 commit comments

Comments
 (0)