Skip to content

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Oct 30, 2023

... and fixes to make that happen.

@odersky odersky requested a review from Linyxus October 30, 2023 20:34
@odersky odersky added the cc-experiment Intended to be merged with cc-experiment branch on origin label Oct 30, 2023
@odersky odersky force-pushed the more-stdlib branch 2 times, most recently from 45c7724 to f6cd5c0 Compare November 1, 2023 15:51
The logic gets refused by the added capture refinements.
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.
(capture checks out of the box)
@odersky
Copy link
Contributor Author

odersky commented Nov 4, 2023

@Linyxus Cursory review is fine. Just to get an idea what's in the PR.

Copy link
Contributor

@Linyxus Linyxus left a comment

Choose a reason for hiding this comment

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

I looked at the changes to the capture checker and several stdlib files that caught my eyes, but didn't manage to go through every new capture checked library file. LGTM overall!

@odersky
Copy link
Contributor Author

odersky commented Nov 5, 2023

This is the first version of collections in the standard library that is compiled with capture checking on. We'll use that as a baseline for a comprehensive test case when we refine the capture checking scheme.

@odersky odersky merged commit ef97ee2 into scala:main Nov 5, 2023
@odersky odersky deleted the more-stdlib branch November 5, 2023 11:19
odersky added a commit to dotty-staging/dotty that referenced this pull request Nov 6, 2023
This reverts commit ef97ee2, reversing changes made to 5454110.
@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

cc-experiment Intended to be merged with cc-experiment branch on origin

3 participants