Skip to content

Conversation

@odersky
Copy link
Contributor

@odersky odersky commented Nov 18, 2025

At the same time, drop Read classifier and the idea that .rd is a kind of restriction. That does not work anymore since .rd has to be combinable with classified capabilities like Unscoped.

 - FreshCaps with Unscoped classifier are assumed to be owned by the enclosing toplevel class
 - FreshCaps with unscoped classifier are not turned into ResultCaps in the return types of
   anonymous functions.
This reverts commit 9abbb03.
This reverts commit 0a0e666.
This reverts commit 67ba9b5.

Read-only cannot be a classifier anymore, since it would overlap with Unscoped,
but neither subsumes the other.
@odersky odersky requested a review from a team as a code owner November 18, 2025 13:00
Allow both .only[C] and .rd (in this order).
If a class has fresh fields and all fields are read-only, only imply `cap.rd`,
not `cap`.
Treat it like an expression `e` instead.
odersky and others added 4 commits November 20, 2025 13:50
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: We still have some quirks w.r.t. classifiers which should be addressed in a follow-up PR.

Copy link
Contributor

@bracevac bracevac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. We also need to make sure that scaladoc still works.
It should once this is merged, because it still relies on read-only not being a .only.

@odersky odersky merged commit bc5f15e into scala:main Nov 20, 2025
45 checks passed
@odersky odersky deleted the add-unscoped branch November 20, 2025 18:53
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