Skip to content

Add Sugar for Variadics #38787

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 2 commits into from
Aug 6, 2021
Merged

Add Sugar for Variadics #38787

merged 2 commits into from
Aug 6, 2021

Conversation

CodaFi
Copy link
Contributor

@CodaFi CodaFi commented Aug 6, 2021

We used to represent the interface type of variadic parameters directly
with ArraySliceType. This was awfully convenient for the constraint
solver since it could just canonicalize and open [T] to Array<$T>
wherever it saw a variadic parameter. However, this both destroys the
sugaring of T... and locks the representation to Array. In the
interest of generalizing this in the future, introduce
VariadicSequenceType. For now, it canonicalizes to Array just like
the old representation. But, as you can guess, this is a new staging
point for teaching the solver how to munge variadic generic type bindings.

rdar://81628287

CodaFi added 2 commits August 6, 2021 12:51
We used to represent the interface type of variadic parameters directly
with ArraySliceType. This was awfully convenient for the constraint
solver since it could just canonicalize and open [T] to Array<$T>
wherever it saw a variadic parameter. However, this both destroys the
sugaring of T... and locks the representation to Array<T>. In the
interest of generalizing this in the future, introduce
VariadicSequenceType. For now, it canonicalizes to Array<T> just like
the old representation. But, as you can guess, this is a new staging
point for teaching the solver how to munge variadic generic type bindings.

rdar://81628287
@CodaFi CodaFi requested a review from DougGregor August 6, 2021 19:52
@CodaFi
Copy link
Contributor Author

CodaFi commented Aug 6, 2021

@swift-ci smoke test

@CodaFi
Copy link
Contributor Author

CodaFi commented Aug 6, 2021

@CodaFi CodaFi merged commit a920ba2 into swiftlang:main Aug 6, 2021
@CodaFi CodaFi deleted the the-nth-degree branch August 6, 2021 23:10
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