Skip to content

[SE-0358][stdlib] Adopt primary associated types #41843

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 9 commits into from
Jun 24, 2022

Conversation

lorentey
Copy link
Member

@lorentey lorentey commented Mar 16, 2022

This draft PR experiments with the adoption of the proposed new language feature for lightweight same-type syntax for primary associated types in the Swift Standard Library.

@lorentey lorentey force-pushed the adopt-primary-associated-types branch from c9c82fd to 4f77602 Compare March 31, 2022 23:33
@lorentey lorentey added the swift evolution pending discussion Flag → feature: A feature that has a Swift evolution proposal currently in review label Mar 31, 2022
@lorentey
Copy link
Member Author

This now reflects the latest revision of SE-0346, which made things a lot nicer!

@lorentey
Copy link
Member Author

lorentey commented Apr 4, 2022

@swift-ci test

@lorentey
Copy link
Member Author

lorentey commented Apr 5, 2022

(The failed builds are expected; this feature is currently gated on -enable-parameterized-protocol-types, which this PR does not enable for the stdlib yet.)

@lorentey
Copy link
Member Author

lorentey commented Apr 8, 2022

@swift-ci test

@milseman
Copy link
Member

milseman commented May 6, 2022

Status of this work? This is blocking regex algorithms, which currently have an ABI of returning Array (i.e. force an eager and allocation)

@lorentey lorentey force-pushed the adopt-primary-associated-types branch from 3694676 to eed5bd1 Compare May 10, 2022 01:12
@lorentey lorentey marked this pull request as ready for review May 10, 2022 01:18
@lorentey lorentey changed the title [stdlib][draft] Adopt primary associated types [stdlib] Adopt primary associated types May 10, 2022
@lorentey
Copy link
Member Author

@swift-ci test

`Element` is expected to always be `Self`. `RawValue` would be a better choice for the primary type ("option set of UInt32"), but to avoid confusion, it seems better to just omit the declaration, at least for now.
@lorentey
Copy link
Member Author

@swift-ci test

@lorentey
Copy link
Member Author

@swift-ci test macOS platform

@lorentey lorentey changed the title [stdlib] Adopt primary associated types [SE-0358][stdlib] Adopt primary associated types Jun 24, 2022
@lorentey
Copy link
Member Author

SE-0358 is still in review due to OptionSet losing its primary associated type. However, we seemed to have settled on the rest of the proposal.

I think we should provisionally land this to unblock the work on Regex matches. Any last-minute updates are very unlikely to affect the collection protocol hierarchy, and regular expressions will not depend on anything else in here.

@lorentey lorentey merged commit 789545d into swiftlang:main Jun 24, 2022
@lorentey lorentey deleted the adopt-primary-associated-types branch June 24, 2022 17:46
@TNTurner23 TNTurner23 mentioned this pull request Dec 18, 2023
@AnthonyLatsis AnthonyLatsis added swift evolution implemented Flag → feature: A feature that was approved through the Swift evolution process and implemented and removed swift evolution pending discussion Flag → feature: A feature that has a Swift evolution proposal currently in review labels Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
swift evolution implemented Flag → feature: A feature that was approved through the Swift evolution process and implemented
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants