Skip to content

Commit af933c4

Browse files
authored
Existential Capabilities (#20566)
The design has changed quite a bit relative to #20470. It is written up as a doc comment on object cc.Existentials.
2 parents 6363df8 + fac643a commit af933c4

File tree

134 files changed

+3010
-924
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+3010
-924
lines changed

compiler/src/dotty/tools/dotc/ast/untpd.scala

+8-3
Original file line numberDiff line numberDiff line change
@@ -521,12 +521,17 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
521521
def captureRoot(using Context): Select =
522522
Select(scalaDot(nme.caps), nme.CAPTURE_ROOT)
523523

524-
def captureRootIn(using Context): Select =
525-
Select(scalaDot(nme.caps), nme.capIn)
526-
527524
def makeRetaining(parent: Tree, refs: List[Tree], annotName: TypeName)(using Context): Annotated =
528525
Annotated(parent, New(scalaAnnotationDot(annotName), List(refs)))
529526

527+
def makeCapsOf(id: Ident)(using Context): Tree =
528+
TypeApply(Select(scalaDot(nme.caps), nme.capsOf), id :: Nil)
529+
530+
def makeCapsBound()(using Context): Tree =
531+
makeRetaining(
532+
Select(scalaDot(nme.caps), tpnme.CapSet),
533+
Nil, tpnme.retainsCap)
534+
530535
def makeConstructor(tparams: List[TypeDef], vparamss: List[List[ValDef]], rhs: Tree = EmptyTree)(using Context): DefDef =
531536
DefDef(nme.CONSTRUCTOR, joinParams(tparams, vparamss), TypeTree(), rhs)
532537

0 commit comments

Comments
 (0)