File tree Expand file tree Collapse file tree 2 files changed +2
-11
lines changed
compiler/src/dotty/tools/dotc/cc Expand file tree Collapse file tree 2 files changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,6 @@ trait CaptureRef extends TypeProxy, ValueType:
108108 * TODO: Document cases with more comments.
109109 */
110110 final def subsumes (y : CaptureRef )(using Context ): Boolean =
111-
112111 def subsumingRefs (x : Type , y : Type ): Boolean = x match
113112 case x : CaptureRef => y match
114113 case y : CaptureRef => x.subsumes(y)
@@ -119,6 +118,7 @@ trait CaptureRef extends TypeProxy, ValueType:
119118 case info : SingletonCaptureRef => test(info)
120119 case info : AndType => viaInfo(info.tp1)(test) || viaInfo(info.tp2)(test)
121120 case info : OrType => viaInfo(info.tp1)(test) && viaInfo(info.tp2)(test)
121+ case info @ CapturingType (_,_) if this .derivesFrom(defn.Caps_CapSet ) => test(info)
122122 case _ => false
123123
124124 (this eq y)
@@ -149,7 +149,7 @@ trait CaptureRef extends TypeProxy, ValueType:
149149 y.info match
150150 case TypeBounds (_, hi : CaptureRef ) => this .subsumes(hi)
151151 case _ => y.captureSetOfInfo.elems.forall(this .subsumes)
152- case CapturingType (parent, refs) if parent.derivesFrom(defn.Caps_CapSet ) =>
152+ case CapturingType (parent, refs) if parent.derivesFrom(defn.Caps_CapSet ) || this .derivesFrom(defn. Caps_CapSet ) =>
153153 refs.elems.forall(this .subsumes)
154154 case _ => false
155155 || this .match
Original file line number Diff line number Diff line change @@ -298,15 +298,6 @@ sealed abstract class CaptureSet extends Showable:
298298 else BiMapped (asVar, tm, mappedElems)
299299 case tm : IdentityCaptRefMap =>
300300 this
301- case av : AvoidMap =>
302- val mapped = mapRefs(elems, ref => ref match
303- case n : NamedType if av.toAvoid(n) => empty // TODO what about variance?
304- case r => extrapolateCaptureRef(r, av, av.variance)
305- )
306- if isConst then
307- if mapped.isConst && mapped.elems == elems && ! mapped.keepAlways then this
308- else mapped
309- else Mapped (asVar, av, av.variance, mapped)
310301 case _ =>
311302 val mapped = mapRefs(elems, tm, tm.variance)
312303 if isConst then
You can’t perform that action at this time.
0 commit comments