File tree Expand file tree Collapse file tree 2 files changed +9
-12
lines changed
compiler/src/dotty/tools/dotc/printing Expand file tree Collapse file tree 2 files changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -52,15 +52,9 @@ class DecompilerPrinter(_ctx: Context) extends RefinedPrinter(_ctx) {
52
52
}
53
53
}
54
54
55
- override protected def toTextCore [T >: Untyped ](tree : Tree [T ]): Text = {
56
- import untpd .{modsDeco => _ , _ }
57
- tree match {
58
- case TypeApply (fun, args) =>
59
- if (tree.symbol eq defn.quoteMethod) " '"
60
- else if (tree.symbol eq defn.typeQuoteMethod) " '[" ~ toTextGlobal(args, " , " ) ~ " ]"
61
- else super .toTextCore(tree)
62
- case _ =>
63
- super .toTextCore(tree)
64
- }
55
+ override protected def typeApplyText [T >: Untyped ](tree : TypeApply [T ]): Text = {
56
+ if (tree.symbol eq defn.quoteMethod) " '"
57
+ else if (tree.symbol eq defn.typeQuoteMethod) " '[" ~ toTextGlobal(tree.args, " , " ) ~ " ]"
58
+ else super .typeApplyText(tree)
65
59
}
66
60
}
Original file line number Diff line number Diff line change @@ -229,6 +229,9 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
229
229
protected def blockText [T >: Untyped ](trees : List [Tree [T ]]): Text =
230
230
(" {" ~ toText(trees, " \n " ) ~ " }" ).close
231
231
232
+ protected def typeApplyText [T >: Untyped ](tree : TypeApply [T ]): Text =
233
+ toTextLocal(tree.fun) ~ " [" ~ toTextGlobal(tree.args, " , " ) ~ " ]"
234
+
232
235
protected def toTextCore [T >: Untyped ](tree : Tree [T ]): Text = {
233
236
import untpd .{modsDeco => _ , _ }
234
237
@@ -308,8 +311,8 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
308
311
}
309
312
else
310
313
toTextLocal(fun) ~ " (" ~ toTextGlobal(args, " , " ) ~ " )"
311
- case TypeApply (fun, args) =>
312
- toTextLocal(fun) ~ " [ " ~ toTextGlobal(args, " , " ) ~ " ] "
314
+ case tree : TypeApply =>
315
+ typeApplyText(tree)
313
316
case Literal (c) =>
314
317
tree.typeOpt match {
315
318
case ConstantType (tc) => withPos(toText(tc), tree.pos)
You can’t perform that action at this time.
0 commit comments