File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -2613,11 +2613,8 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
26132613 val refs2 = tp2.captureSet
26142614 if subCaptures(refs2, refs1, frozen = true ).isOK
26152615 && tp1.isBoxedCapturing == tp2.isBoxedCapturing
2616- then
2617- if refs2.isAlwaysEmpty then parent1 & tp2
2618- else (parent1 & tp2).capturing(refs2)
2619- else
2620- tp1.derivedCapturingType(parent1 & tp2, refs1)
2616+ then (parent1 & tp2).capturing(refs2)
2617+ else tp1.derivedCapturingType(parent1 & tp2, refs1)
26212618 case tp1 : AnnotatedType if ! tp1.isRefining =>
26222619 tp1.underlying & tp2
26232620 case _ =>
Original file line number Diff line number Diff line change @@ -1940,7 +1940,7 @@ object Types {
19401940 * the two capture sets are combined.
19411941 */
19421942 def capturing (cs : CaptureSet )(using Context ): Type =
1943- if cs.isConst && cs.subCaptures(captureSet, frozen = true ).isOK then this
1943+ if cs.isAlwaysEmpty || cs. isConst && cs.subCaptures(captureSet, frozen = true ).isOK then this
19441944 else this match
19451945 case CapturingType (parent, cs1) => parent.capturing(cs1 ++ cs)
19461946 case _ => CapturingType (this , cs)
You can’t perform that action at this time.
0 commit comments