File tree 1 file changed +7
-2
lines changed
compiler/src/dotty/tools/dotc/printing
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,8 @@ class PlainPrinter(_ctx: Context) extends Printer {
142
142
toTextRef(tp) ~ " .type"
143
143
case tp : TermRef if tp.denot.isOverloaded =>
144
144
" <overloaded " ~ toTextRef(tp) ~ " >"
145
+ case tp : AppliedTermRef =>
146
+ " {" ~ toTextRef(tp) ~ " }"
145
147
case tp : TypeRef =>
146
148
if (printWithoutPrefix.contains(tp.symbol))
147
149
toText(tp.name)
@@ -291,8 +293,11 @@ class PlainPrinter(_ctx: Context) extends Printer {
291
293
case tp : TermRef =>
292
294
toTextPrefix(tp.prefix) ~ selectionString(tp)
293
295
case AppliedTermRef (fn, args) =>
294
- // TODO(gsps): Print AppliedTermRef as in surface syntax (using curly braces)
295
- (toTextRef(fn) ~ " (" ~ Text (args map argText, " , " ) ~ " )" ).close
296
+ val argTexts = args.map {
297
+ case arg : SingletonType => toTextRef(arg)
298
+ case arg => argText(arg)
299
+ }
300
+ (toTextRef(fn) ~ " (" ~ Text (argTexts, " , " ) ~ " )" ).close
296
301
case tp : ThisType =>
297
302
nameString(tp.cls) + " .this"
298
303
case SuperType (thistpe : SingletonType , _) =>
You can’t perform that action at this time.
0 commit comments