We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5e9e41c commit 22a2e5aCopy full SHA for 22a2e5a
compiler/src/dotty/tools/dotc/cc/CaptureOps.scala
@@ -232,9 +232,7 @@ extension (tp: Type)
232
case tp @ ReachCapability(_) =>
233
tp.singletonCaptureSet
234
case ReadOnlyCapability(ref) =>
235
- val refDcs = ref.deepCaptureSet(includeTypevars)
236
- if refDcs.isConst then CaptureSet(refDcs.elems.map(_.readOnly))
237
- else refDcs // this case should not happen for correct programs
+ ref.deepCaptureSet(includeTypevars).readOnly
238
case tp: SingletonCaptureRef if tp.isTrackableRef =>
239
tp.reach.singletonCaptureSet
240
case _ =>
0 commit comments