Skip to content

[Runtime] Wrap _checkGenericRequirements for _instantiateCheckedGenericMetadata #68844

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
Oct 10, 2023

Conversation

Azoy
Copy link
Contributor

@Azoy Azoy commented Sep 28, 2023

Previously, callers to _gatherGenericParameters had to provide all generic parameters, even non-key ones. This made initializing something like:

struct A<T> {}

extension A where T == Int {
  struct B {}
}

with B pretty awkward because the metadata accessor only has a single parameter (the request) and has 0 key arguments. Teach _gatherGenericParameters to handle callers only passing in the required key generic parameters.

@Azoy
Copy link
Contributor Author

Azoy commented Sep 28, 2023

@swift-ci please test

@Azoy Azoy force-pushed the gather-no-parameters branch from a410885 to 3ddec4f Compare October 9, 2023 22:02
@Azoy Azoy changed the title [Runtime] Teach _gatherGenericParameters to handle only key arguments [Runtime] Wrap _checkGenericRequirements for _instantiateCheckedGenericMetadata Oct 9, 2023
@Azoy
Copy link
Contributor Author

Azoy commented Oct 9, 2023

@swift-ci please test

@Azoy Azoy merged commit ccaf427 into swiftlang:main Oct 10, 2023
@Azoy Azoy deleted the gather-no-parameters branch October 10, 2023 18:08
Azoy added a commit to Azoy/swift that referenced this pull request Oct 10, 2023
[Runtime] Wrap _checkGenericRequirements for _instantiateCheckedGenericMetadata
@slavapestov
Copy link
Contributor

I still have some concerns about this change. I commented on the 5.9 PR: #69100

Azoy added a commit to Azoy/swift that referenced this pull request Oct 11, 2023
…ters"

This reverts commit ccaf427, reversing
changes made to bf45c55.
Azoy added a commit that referenced this pull request Oct 11, 2023
Revert "Merge pull request #68844 from Azoy/gather-no-parameters"
meg-gupta pushed a commit to meg-gupta/swift that referenced this pull request Oct 13, 2023
…ters"

This reverts commit ccaf427, reversing
changes made to bf45c55.
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.

3 participants