-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Reorganize standard library collections under cc #18858
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
odersky
commented
Nov 6, 2023
•
edited
Loading
edited
- Revert previous merge commit
- Add all changes to capture tracking in the compiler to make (4) go through.
- Add all collection classes without changes to test directory in one commit 3caf116.
- Add all changes to collection classes made for capture checking in another commit b5bfbab.
Also count abstract types that have a @Sealed annotation on their bound as sealed. That way, we get free propagation into synthesized type parameters. We should probably unify this scheme and `sealed` modifiers.
This needs to be refined further for class members, similar to how we check that private types cannot escape from a class API.
The tricky thing here is how to recognize that a class is pure since that is known only during capture checking and we are at Setup, the phase before. But we can approximate by treating the `Pure` trait as definitely pure.
# Conflicts: # tests/pos-special/stdlib/collection/ArrayOps.scala
Mutable variables can appeal to parametricty only if they are not captured. We use "not captured by any closure" as a sound approximation for that, since variables themselves are currently not tracked, so we cannot use soemthing more finegrained.
The logic gets confused by the added capture refinements.
There are still some unchecked files in collection/convert/impl. They mostly deal with Java Spliterators. It will require some non-local changes to add these, so that's left for a future commit. It would be a good issue for someone to get up to speed on this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.