File tree 2 files changed +2
-11
lines changed
compiler/src/dotty/tools/dotc/cc
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:
108
108
* TODO: Document cases with more comments.
109
109
*/
110
110
final def subsumes (y : CaptureRef )(using Context ): Boolean =
111
-
112
111
def subsumingRefs (x : Type , y : Type ): Boolean = x match
113
112
case x : CaptureRef => y match
114
113
case y : CaptureRef => x.subsumes(y)
@@ -119,6 +118,7 @@ trait CaptureRef extends TypeProxy, ValueType:
119
118
case info : SingletonCaptureRef => test(info)
120
119
case info : AndType => viaInfo(info.tp1)(test) || viaInfo(info.tp2)(test)
121
120
case info : OrType => viaInfo(info.tp1)(test) && viaInfo(info.tp2)(test)
121
+ case info @ CapturingType (_,_) if this .derivesFrom(defn.Caps_CapSet ) => test(info)
122
122
case _ => false
123
123
124
124
(this eq y)
@@ -149,7 +149,7 @@ trait CaptureRef extends TypeProxy, ValueType:
149
149
y.info match
150
150
case TypeBounds (_, hi : CaptureRef ) => this .subsumes(hi)
151
151
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 ) =>
153
153
refs.elems.forall(this .subsumes)
154
154
case _ => false
155
155
|| this .match
Original file line number Diff line number Diff line change @@ -298,15 +298,6 @@ sealed abstract class CaptureSet extends Showable:
298
298
else BiMapped (asVar, tm, mappedElems)
299
299
case tm : IdentityCaptRefMap =>
300
300
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)
310
301
case _ =>
311
302
val mapped = mapRefs(elems, tm, tm.variance)
312
303
if isConst then
You can’t perform that action at this time.
0 commit comments