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 1d92033 commit d749137Copy full SHA for d749137
compiler/src/dotty/tools/dotc/cc/CaptureOps.scala
@@ -229,12 +229,12 @@ extension (tp: Type)
229
* in the type, as computed by `CaptureSet.ofTypeDeeply`.
230
*/
231
def deepCaptureSet(using Context): CaptureSet =
232
- val dcs = CaptureSet.ofTypeDeeply(tp)
233
- if dcs.isAlwaysEmpty then dcs
+ val dcs = CaptureSet.ofTypeDeeply(tp.widen.stripCapturing)
+ if dcs.isAlwaysEmpty then tp.captureSet
234
else tp match
235
case tp @ ReachCapability(_) => tp.singletonCaptureSet
236
- case tp: SingletonCaptureRef => tp.reach.singletonCaptureSet
237
- case _ => dcs
+ case tp: SingletonCaptureRef if tp.isTrackableRef => tp.reach.singletonCaptureSet
+ case _ => tp.captureSet ++ dcs
238
239
/** A type capturing `ref` */
240
def capturing(ref: CaptureRef)(using Context): Type =
0 commit comments