File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -2610,10 +2610,12 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
26102610 case tp1 : TypeVar if tp1.isInstantiated =>
26112611 tp1.underlying & tp2
26122612 case CapturingType (parent1, refs1) =>
2613- if subCaptures(tp2.captureSet, refs1, frozen = true ).isOK
2613+ val refs2 = tp2.captureSet
2614+ if subCaptures(refs2, refs1, frozen = true ).isOK
26142615 && tp1.isBoxedCapturing == tp2.isBoxedCapturing
26152616 then
2616- parent1 & tp2
2617+ if refs2.isAlwaysEmpty then parent1 & tp2
2618+ else (parent1 & tp2).capturing(refs2)
26172619 else
26182620 tp1.derivedCapturingType(parent1 & tp2, refs1)
26192621 case tp1 : AnnotatedType if ! tp1.isRefining =>
You can’t perform that action at this time.
0 commit comments