Skip to content

Commit c6fa1a4

Browse files
committed
-Ytest-pickler: Fix printing of This
1 parent f32eefc commit c6fa1a4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,8 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
303303
if (qual.isType) toTextLocal(qual) ~ "#" ~ toText(name)
304304
else toTextLocal(qual) ~ ("." ~ nameIdText(tree) provided name != nme.CONSTRUCTOR)
305305
case tree: This =>
306-
optDotPrefix(tree) ~ "this" ~ idText(tree)
306+
if (homogenizedView && tree.hasType) toText(tree.typeOpt) // We only pickle the type of This, not the tree
307+
else optDotPrefix(tree) ~ "this" ~ idText(tree)
307308
case Super(qual: This, mix) =>
308309
optDotPrefix(qual) ~ "super" ~ optText(mix)("[" ~ _ ~ "]")
309310
case Apply(fun, args) =>

0 commit comments

Comments
 (0)