Skip to content

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 19 commits into from
Nov 14, 2023

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Nov 6, 2023

  1. Revert previous merge commit
  2. Add all changes to capture tracking in the compiler to make (4) go through.
  3. Add all collection classes without changes to test directory in one commit 3caf116.
  4. Add all changes to collection classes made for capture checking in another commit b5bfbab.

This reverts commit ef97ee2, reversing
changes made to 5454110.
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.
@odersky odersky changed the title Reorganize standard library collection Reorganize standard library collections under cc Nov 6, 2023
@odersky
Copy link
Contributor Author

odersky commented Nov 6, 2023

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.

@odersky odersky merged commit 49587e2 into scala:main Nov 14, 2023
@odersky odersky deleted the stdlib-2 branch November 14, 2023 09:46
@Kordyjan Kordyjan added this to the 3.4.0 milestone Dec 20, 2023
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