Skip to content

[SE-0393] Require the repeat keyword for generic requirement expansions. #65134

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 1 commit into from
Apr 13, 2023

Conversation

hborla
Copy link
Member

@hborla hborla commented Apr 13, 2023

Implementation for the first revision in swiftlang/swift-evolution#2004

Require the repeat keyword for generic requirements that capture type parameter packs, which are called generic requirement expansions, as they expand out to zero or more generic requirements under pack substitution.

func requirement<each T>() where repeat G<each T>.A == Int {}

Under substitution T := Pack{Int, String, Bool} the requirement expansion repeat G<each T>.A == Int expands into the following list of requirements: G<Int>.A == Int, G<String>.A == Int, G<Bool>.A == Int.

@hborla hborla force-pushed the parameter-pack-revision branch from 5077047 to 234b5dc Compare April 13, 2023 05:04
@hborla
Copy link
Member Author

hborla commented Apr 13, 2023

@swift-ci please smoke test

@hborla hborla merged commit 35fcc37 into swiftlang:main Apr 13, 2023
@hborla hborla deleted the parameter-pack-revision branch April 13, 2023 15:33
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.

1 participant