Skip to content

Commit d1fe1fd

Browse files
committed
Fix infinite recursion in CapToFresh
1 parent 5b587b5 commit d1fe1fd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/cc/Capability.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -898,9 +898,9 @@ object Capabilities:
898898
case t @ AnnotatedType(parent, ann) =>
899899
val parent1 = this(parent)
900900
if ann.symbol.isRetains && ann.tree.toCaptureSet.containsCap then
901-
// TODO: this can cause infinite recursion in some cases during printing
901+
// Applying `this` can cause infinite recursion in some cases during printing.
902902
// scalac -Xprint:all tests/pos/i23885/S_1.scala tests/pos/i23885/S_2.scala
903-
this(CapturingType(parent1, ann.tree.toCaptureSet))
903+
mapOver(CapturingType(parent1, ann.tree.toCaptureSet))
904904
else
905905
t.derivedAnnotatedType(parent1, ann)
906906
case defn.RefinedFunctionOf(_) =>

0 commit comments

Comments
 (0)