@@ -318,7 +318,8 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
318
318
if (name.isTypeName) typeText(txt)
319
319
else txt
320
320
case tree @ Select (qual, name) =>
321
- if (qual.isType) toTextLocal(qual) ~ " #" ~ typeText(toText(name))
321
+ if (tree.hasType && tree.symbol == defn.QuotedExpr_~ || tree.symbol == defn.QuotedType_~ ) keywordStr(" ~(" ) ~ toTextLocal(qual) ~ keywordStr(" )" )
322
+ else if (qual.isType) toTextLocal(qual) ~ " #" ~ typeText(toText(name))
322
323
else toTextLocal(qual) ~ (" ." ~ nameIdText(tree) provided name != nme.CONSTRUCTOR )
323
324
case tree : This =>
324
325
optDotPrefix(tree) ~ keywordStr(" this" ) ~ idText(tree)
@@ -329,6 +330,10 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
329
330
changePrec (GlobalPrec ) {
330
331
keywordStr(" throw " ) ~ toText(args.head)
331
332
}
333
+ else if (fun.hasType && fun.symbol == defn.QuotedExpr_apply )
334
+ keywordStr(" '{" ) ~ toTextGlobal(args, " , " ) ~ keywordStr(" }" )
335
+ else if (fun.hasType && fun.symbol == defn.QuotedType_apply )
336
+ keywordStr(" '[" ) ~ toTextGlobal(args, " , " ) ~ keywordStr(" ]" )
332
337
else
333
338
toTextLocal(fun) ~ " (" ~ toTextGlobal(args, " , " ) ~ " )"
334
339
case tree : TypeApply =>
@@ -558,7 +563,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
558
563
keywordStr(" try " ) ~ toText(expr) ~ " " ~ keywordStr(" catch" ) ~ " {" ~ toText(handler) ~ " }" ~ optText(finalizer)(keywordStr(" finally " ) ~ _)
559
564
}
560
565
case Quote (tree) =>
561
- if (tree.isType) " '[" ~ toTextGlobal(tree) ~ " ]" else " '( " ~ toTextGlobal(tree) ~ " ) "
566
+ if (tree.isType) keywordStr( " '[" ) ~ toTextGlobal(tree) ~ keywordStr( " ]" ) else keywordStr( " '{ " ) ~ toTextGlobal(tree) ~ keywordStr( " } " )
562
567
case Thicket (trees) =>
563
568
" Thicket {" ~~ toTextGlobal(trees, " \n " ) ~~ " }"
564
569
case _ =>
0 commit comments