-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fixes for mutability #24205
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
Fixes for mutability #24205
Conversation
ee48108 to
e66d53a
Compare
They still were read-only, but all Capabilities implicitly capture `cap` now.
3ed1c87 to
958eb30
Compare
- this of a Mutable type is exclusive in update methods, read-only elsewhere - a selection from a mutable type with read-only capture set is again read-only
Need to disable `associateWithMutable` for them.
958eb30 to
6642e08
Compare
Treat them analogous to calls of update methods
- whether we record x or x.rd also depends on the exclusivity in context - fix issue of missing updates for denotations when recording use of a path
| Sometimes, disallowing assignments to mutable fields from normal methods is too restrictive. For instance: | ||
| ```scala | ||
| class Cache[T](eval: () -> T): | ||
| private transparent var x: T = compiletime.uninitialized |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like reusing the keyword transparent again for another different meaning...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can certainly discuss this. Any suggestions what might be a better modifier?
122d5a2 to
b18794c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why my changes were overridden, but such changes should also be made in project/resources/referenceReplacements/sidebar.yml.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated it now.
New doc page on mutability, split off from "Separation Checking".
b18794c to
1f7b608
Compare
|
Are there any tests from the mutability qualifiers paper that we could adapt to use here? Or from the paper that Ed presented at Scala Workshop? |
Whether something is mutable or not depends on the context: