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
2610
2610
case tp1 : TypeVar if tp1.isInstantiated =>
2611
2611
tp1.underlying & tp2
2612
2612
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
2614
2615
&& tp1.isBoxedCapturing == tp2.isBoxedCapturing
2615
2616
then
2616
- parent1 & tp2
2617
+ if refs2.isAlwaysEmpty then parent1 & tp2
2618
+ else (parent1 & tp2).capturing(refs2)
2617
2619
else
2618
2620
tp1.derivedCapturingType(parent1 & tp2, refs1)
2619
2621
case tp1 : AnnotatedType if ! tp1.isRefining =>
You can’t perform that action at this time.
0 commit comments