Skip to content

Commit a48d4ef

Browse files
committed
Insert a space between symbol and `:' when printing SelectionProtos
Previously, we'd see something like `? { :+: Int }`, which is confusing. Now we see instead `? { :+ : Int }`.
1 parent 2efe47f commit a48d4ef

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
148148
case JavaArrayType(elemtp) =>
149149
return toText(elemtp) ~ "[]"
150150
case tp: SelectionProto =>
151-
return "?{ " ~ toText(tp.name) ~ ": " ~ toText(tp.memberProto) ~ " }"
151+
return "?{ " ~ toText(tp.name) ~ (" " provided !tp.name.decode.last.isLetterOrDigit) ~
152+
": " ~ toText(tp.memberProto) ~ " }"
152153
case tp: ViewProto =>
153154
return toText(tp.argType) ~ " ?=>? " ~ toText(tp.resultType)
154155
case tp @ FunProto(args, resultType, _) =>

0 commit comments

Comments
 (0)