Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Existential Capabilities #20566

Merged
merged 61 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
0e71645
More robust level handling
odersky Jun 5, 2024
5b9d305
Add existential capabilities, 2nd draft
odersky Jun 5, 2024
b375d97
Generalize isAlwaysEmpty and streamline isBoxedCaptured
odersky Jun 6, 2024
f9ddc71
Refine class refinements
odersky Jun 7, 2024
0458012
Improve handling of no-cap-under-box/unbox errors
odersky Jun 7, 2024
24506ae
Go back to original no cap in box/unbox restrictions
odersky Jun 7, 2024
1008a0d
More robust scheme to re-check definitions once.
odersky Jun 10, 2024
a30cf47
Show unsuccessful subCapture tests in TypeMismatch explanations
odersky Jun 10, 2024
20b8630
Enable existential capabilities
odersky Jun 10, 2024
ca715e8
Tighten rules against escaping local references
odersky Jun 13, 2024
b9c2109
Go back to expansion of capability class references at Setup
odersky Jun 13, 2024
420f2cd
Drop expandedUniversalSet
odersky Jun 13, 2024
e9474ff
Adapt new capability class scheme to existentials
odersky Jun 13, 2024
0161bb0
Map capability classes to existentials
odersky Jun 13, 2024
7296b40
Change encoding of impure dependent function types
odersky Jun 14, 2024
4add745
Fix mapping of cap to existentials
odersky Jun 15, 2024
d5c15dd
Let only value types derive from Capabilities
odersky Jun 15, 2024
d242e01
Type inference for existentials
odersky Jun 17, 2024
687516e
Drop checkReachCapsIsolated restriction
odersky Jun 17, 2024
9b27b69
Drop no universal in deep capture set test everywhere from source 3.5
odersky Jun 17, 2024
1d3ae88
Disallow to box or unbox existentials
odersky Jun 17, 2024
4ad9e3c
Fix existential mapping of non-dependent impure function aliases =>
odersky Jun 17, 2024
b950c7d
Drop restrictions in widenReachCaptures
odersky Jun 17, 2024
adfb700
Cleanup ccConfig settings
odersky Jun 18, 2024
7bf8be7
Don't add ^ to singleton capabilities during Setup
odersky Jun 18, 2024
cd78a9e
Refine parameter accessors that have nonempty deep capture sets
odersky Jun 21, 2024
28f4bb5
More precise capture set unions
odersky Jun 23, 2024
04aa63d
First implementation of capture polymorphism
odersky Jun 26, 2024
9436f11
Reclassify maximal capabilities
odersky Jun 27, 2024
7ac94c9
Bring back RefiningVar
odersky Jun 27, 2024
aad3395
Allow for embedded CapSet^{refs} entries in capture sets
odersky Jun 27, 2024
1c11071
Improve printing of capture sets before cc
odersky Jun 28, 2024
72462a7
Add some neg tests
odersky Jun 28, 2024
0a1854d
Update doc page
odersky Jun 29, 2024
c965322
Fix glb logic involving capturing types
odersky Jul 6, 2024
2cd685a
Add option to avoid intersections for class refinements
odersky Jul 8, 2024
8b03405
Fix printing of reach capabilities
odersky Jul 8, 2024
520100b
Introduced @unboxed parameters
odersky Jul 9, 2024
7708276
Fix accidentally enabled warning about open classes
odersky Jul 9, 2024
2b04423
Disable special treatment of eta expansions in recheckClosure
odersky Jul 9, 2024
074be82
Implement @unboxed annotation exemption for reach capabilities of par…
odersky Jul 9, 2024
1640340
Add @unboxed to failing tests and standard library file Buffer.scala
odersky Jul 9, 2024
4333d3e
Fix isAlwaysPure
odersky Jul 10, 2024
90749ea
Fix special capture set handling in recheckApply, Step 1
odersky Jul 10, 2024
bc818a9
Fix special capture set handling in recheckApply, Step 2
odersky Jul 10, 2024
bb94805
Refactor CaptureRef operations
odersky Jun 28, 2024
cc95088
Break out CaptureRef into a separate file
odersky Jun 28, 2024
3667ab8
Don't box arguments of any form of type cast or test
odersky Jul 10, 2024
d8ace30
Revert "Fix special capture set handling in recheckApply, Step 2"
odersky Jul 11, 2024
7db1d43
Fix special capture set handling in recheckApply, Step 2 revised
odersky Jul 11, 2024
c1036bf
Fix captureSet computations for false reach capabilities
odersky Jul 11, 2024
5a35160
Tweak deep capture set computations
odersky Jul 11, 2024
082214e
Make the unboxed parameter scheme standard
odersky Jul 11, 2024
afcbdcb
Rename @unboxed --> @unbox
odersky Jul 11, 2024
0b22948
Another test
odersky Jul 11, 2024
91cbca8
Check that overrides don't change the @unbox status of their parameters
odersky Jul 12, 2024
54828c7
Fix lubs over capturing types
odersky Jul 13, 2024
c8d418a
Don't do post checks in inlined code
odersky Jul 14, 2024
04dba38
Widen non-trackable singleton types before computing their dcs
odersky Jul 18, 2024
9391b9a
Give some explanation if a capture set was under-approximated
odersky Jul 18, 2024
fac643a
Split postcheck phase in two
odersky Jul 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions compiler/src/dotty/tools/dotc/ast/untpd.scala
Original file line number Diff line number Diff line change
Expand Up @@ -521,12 +521,17 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
def captureRoot(using Context): Select =
Select(scalaDot(nme.caps), nme.CAPTURE_ROOT)

def captureRootIn(using Context): Select =
Select(scalaDot(nme.caps), nme.capIn)

def makeRetaining(parent: Tree, refs: List[Tree], annotName: TypeName)(using Context): Annotated =
Annotated(parent, New(scalaAnnotationDot(annotName), List(refs)))

def makeCapsOf(id: Ident)(using Context): Tree =
TypeApply(Select(scalaDot(nme.caps), nme.capsOf), id :: Nil)

def makeCapsBound()(using Context): Tree =
makeRetaining(
Select(scalaDot(nme.caps), tpnme.CapSet),
Nil, tpnme.retainsCap)

def makeConstructor(tparams: List[TypeDef], vparamss: List[List[ValDef]], rhs: Tree = EmptyTree)(using Context): DefDef =
DefDef(nme.CONSTRUCTOR, joinParams(tparams, vparamss), TypeTree(), rhs)

Expand Down
Loading
Loading