Skip to content

Drop reach capabilities#26246

Draft
odersky wants to merge 17 commits into
scala:mainfrom
dotty-staging:drop-reach
Draft

Drop reach capabilities#26246
odersky wants to merge 17 commits into
scala:mainfrom
dotty-staging:drop-reach

Conversation

@odersky
Copy link
Copy Markdown
Contributor

@odersky odersky commented Jun 6, 2026

Based on #26193

  • Change or disable reach capability tests
  • Drop deprecated features of cap
  • Drop generation of reach capabilties
  • Drop types and infrastructure for reach capabilities

odersky and others added 17 commits June 5, 2026 18:53
Previously, anonymous functions were excluded. lambda-fresh-2.scala shows why this is
unsound. We now drop the special treatment of anonymous functions, and at the same time
exclude LocalCaps that come from outside the function from checking.
Previously, a closure could return an unscoped type with `any` in it
(e.g., `Ref^`) but its type would be a pure function type. We now propagate
the `any` into the function type. This has to be done with care though, since
the `^` of a closure might come from the expected type, in which case we
should ignore it. The tricky bit is distinguishing one from the other.
Drop two unused parameters.
Don't elide even if the capset belongs to a Capability class.
This replaces the special treatment of UnScoped in the ToResult map and
makes Unscoped capabilities more versatile.
A LocalCap never accounts for a ResultCap, even if the classifier is Unscoped.
We need to do it after we widened an Unscoped fresh to any.
Both `// error` and `// warn` will now match
one _or more_ error/warning. In user-facing docs,
we usually do not want to mark every single
error/warning, but just indicate that there
should be some.
This is no longer needed since we now ensure monotonocity of closure types.
If a test can be rewritten using capset variables, do that, otherwise move to
tests/disabled/reaches.
@odersky odersky requested a review from a team as a code owner June 6, 2026 14:30
@odersky odersky marked this pull request as draft June 6, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants