Commit a3dde8b
authored
Exclusive capabilities (#22218)
implement capybara-like mutation checking
- [x] Add read-only capabilities `x.rd`
- [x] Add `Mutable` and `SharedCapability` as subclasses of
`Capability`.
- [x] Add update methods.
- [x] Implement access rules for `Mutable` types - exclusive if they can
invoke an update method, read-only otherwise.
- [x] Add `Fresh.Cap` as a family of new top-types that keep track of
references that were widened to them
- [x] Add a separation checker that checks that references hidden by a
`Fresh.Cap` don't appear as aliases
- [x] In applications
- [x] In sequences of statements and definitions
- [x] in the same type
- [x] Introduce @consume annotation for parameters
- [x] Check that hidden references that are parameters are annotated
with `@consume`
- [x] Check that parameter references passed in arguments to @consume
parameters are also annotated with `@consume`.
To be done in a separate PR: Add qualifiers to capture sets so that we
can talk of the read-only part of a `Mutable` type.File tree
156 files changed
+4075
-744
lines changed- compiler/src/dotty/tools
- backend/jvm
- dotc
- ast
- cc
- core
- parsing
- printing
- reporting
- sbt
- transform
- init
- typer
- util
- docs/_docs/internals
- library/src/scala
- annotation/internal
- project
- scala2-library-cc/src/scala/collection
- immutable
- mutable
- tests
- neg-custom-args/captures
- caseclass
- pos-custom-args/captures
- pos-special/stdlib
- run-custom-args/captures/colltest5
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
156 files changed
+4075
-744
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
288 | | - | |
| 288 | + | |
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2243 | 2243 | | |
2244 | 2244 | | |
2245 | 2245 | | |
| 2246 | + | |
| 2247 | + | |
2246 | 2248 | | |
2247 | 2249 | | |
2248 | 2250 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
755 | 755 | | |
756 | 756 | | |
757 | 757 | | |
758 | | - | |
| 758 | + | |
759 | 759 | | |
760 | 760 | | |
761 | 761 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| 209 | + | |
| 210 | + | |
209 | 211 | | |
210 | 212 | | |
211 | 213 | | |
| |||
332 | 334 | | |
333 | 335 | | |
334 | 336 | | |
| 337 | + | |
335 | 338 | | |
336 | 339 | | |
337 | 340 | | |
| |||
0 commit comments