Skip to content

Commit 041f9ce

Browse files
committed
Make printing of capture sets work also when testing Pickler
1 parent 78c2220 commit 041f9ce

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,9 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
640640
try changePrec(GlobalPrec)(toText(arg) ~ "^" ~ toTextCaptureSet(captureSet))
641641
catch case ex: IllegalCaptureRef => toTextAnnot
642642
if annot.symbol.maybeOwner == defn.RetainsAnnot
643-
&& Feature.ccEnabled && Config.printCaptureSetsAsPrefix && !printDebug
643+
&& Feature.ccEnabled
644+
&& Config.printCaptureSetsAsPrefix && !printDebug
645+
&& Phases.checkCapturesPhase.exists // might be missing on -Ytest-pickler
644646
then toTextRetainsAnnot
645647
else toTextAnnot
646648
case EmptyTree =>

tests/pos-custom-args/captures/i18699.scala

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)