Add restricted capabilities x.only[C]
#23485
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implementation along the lines of #23463
only
-capabilities.Classifier
base trait.only
-capabilities.captureSetOfInfo
foronly
capabilities.x.only[Nothing]
. It should have emptycaptureSetOfInfo
.only
must refer to a classified capability class.- it's
*
, then.only
, then.rd
,- multiple
.only
normalize to the smallest one if the classes are related,- multiple
.only
normalize to the empty capability if the classes are not related.FreshCap
andResultCap
.capToFresh
andtoResultInResults
so that the classifier field is correctly set.tcs
, define when a capability is classified by a classifier class.C
can subsume only capabilities that are classified asC
.-
c.as[C] <: d
ifc <: d
orc.as[D] <: empty
-
c.as[C] <: d.as[D]
ifc <: d
andC
derives fromD
-
c <: d.as[D]
ifc <: d
andc
is classified asD
-
c.as[D] <: empty
iftcs(c)
consists of capabilities that all derive from classifier classes unrelated toD
.