Skip to content

Commit 3a26fe8

Browse files
committed
Fix: Skip existentials in when accessing result type in augmentConstructorType
1 parent daeae71 commit 3a26fe8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import CCState.*
2323
import StdNames.nme
2424
import NameKinds.{DefaultGetterName, WildcardParamName, UniqueNameKind}
2525
import reporting.{trace, Message, OverrideError}
26+
import Existential.derivedExistentialType
2627

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

0 commit comments

Comments
 (0)