Skip to content

Conversation

@odersky
Copy link
Contributor

@odersky odersky commented Oct 30, 2024

Also, several refactorings and fixes to the way we handle applications and markFree. This PR reflects the state of how we can improve the capture checker with fixes and simplifications without changing anything fundamental in the policies.

x*? is x.type @reach @maybe. This was not recognized before.
Previously, we violated that assumption is we too the deep capture set
of a capture reference wiht singleton type.
Count in dcs exactly those locations where a cap gets replaced by a reach capability.
Simplify code that handles applications, avoiding adding pieces of mutable state.
The correct point to address charging reach capabilities is in markFree itself:
When a reach capability goes out of scope, and that capability is not a parameter,
we need to continue with the underlying capture set.
@odersky odersky mentioned this pull request Oct 30, 2024
@odersky odersky added the cc-experiment Intended to be merged with cc-experiment branch on origin label Oct 30, 2024
@odersky odersky requested a review from noti0na1 October 30, 2024 20:24
@odersky
Copy link
Contributor Author

odersky commented Nov 6, 2024

Superseded by #21863

@odersky odersky closed this Nov 6, 2024
noti0na1 added a commit that referenced this pull request Nov 22, 2024
A refactored and consolidated capture checker without any drastic
changes to the algorithm. The main changes are:

- Go back to the "sealed" policy where we check that type parameters do
not contain `cap` instead of checking that we do not box or unbox `cap`.
 - Rename `@unbox` to `@use`
 - Fix several soundness holes relating to reach capabilities

Based on #21861
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cc-experiment Intended to be merged with cc-experiment branch on origin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants