Skip to content

Commit

Permalink
Fix: Skip existentials in when accessing result type in augmentConstr…
Browse files Browse the repository at this point in the history
…uctorType
  • Loading branch information
odersky committed Dec 21, 2024
1 parent daeae71 commit 3a26fe8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import CCState.*
import StdNames.nme
import NameKinds.{DefaultGetterName, WildcardParamName, UniqueNameKind}
import reporting.{trace, Message, OverrideError}
import Existential.derivedExistentialType

/** The capture checker */
object CheckCaptures:
Expand Down Expand Up @@ -770,6 +771,8 @@ class CheckCaptures extends Recheck, SymTransformer:
// can happen for curried constructors if instantiate of a previous step
// added capture set to result.
augmentConstructorType(parent, initCs ++ refs)
case core @ Existential(boundVar, core1) =>
core.derivedExistentialType(augmentConstructorType(core1, initCs))
case _ =>
val (refined, cs) = addParamArgRefinements(core, initCs)
refined.capturing(cs)
Expand Down

0 comments on commit 3a26fe8

Please sign in to comment.