File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
compiler/src/dotty/tools/dotc/cc Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -210,10 +210,11 @@ sealed abstract class CaptureSet extends Showable:
210
210
* any of the elements in the constant capture set `that`
211
211
*/
212
212
def -- (that : CaptureSet .Const )(using Context ): CaptureSet =
213
- val elems1 = elems.filter(! that.accountsFor(_))
214
- if elems1.size == elems.size then this
215
- else if this .isConst then Const (elems1)
216
- else Diff (asVar, that)
213
+ if this .isConst then
214
+ val elems1 = elems.filter(! that.accountsFor(_))
215
+ if elems1.size == elems.size then this else Const (elems1)
216
+ else
217
+ if that.isAlwaysEmpty then this else Diff (asVar, that)
217
218
218
219
/** The largest subset (via <:<) of this capture set that does not account for `ref` */
219
220
def - (ref : CaptureRef )(using Context ): CaptureSet =
You can’t perform that action at this time.
0 commit comments