We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c80127 commit d07282dCopy full SHA for d07282d
compiler/src/dotty/tools/dotc/cc/CaptureSet.scala
@@ -210,10 +210,11 @@ sealed abstract class CaptureSet extends Showable:
210
* any of the elements in the constant capture set `that`
211
*/
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)
+ if this.isConst then
+ val elems1 = elems.filter(!that.accountsFor(_))
+ if elems1.size == elems.size then this else Const(elems1)
+ else
217
+ if that.isAlwaysEmpty then this else Diff(asVar, that)
218
219
/** The largest subset (via <:<) of this capture set that does not account for `ref` */
220
def - (ref: CaptureRef)(using Context): CaptureSet =
0 commit comments