Skip to content

Conversation

@artemcm
Copy link
Contributor

@artemcm artemcm commented Jul 5, 2023

Cherry-pick of #67034

• Release: 5.9
• Explanation: To reduce duplication of logic with other parts of the compiler, instead of destructuring the constraint type, write the requirements in the opaque type declaration's generic signature. This also carries a functional fix of correctly aligning the type alias name with the corresponding type witness, instead of attempting to align those from different sources.
• Reviewed by: @slavapestov
• Scope of Issue: Incorrect mapping of opaque return type type alias same-type requirements to the corresponding protocol associated type label may lead to incorrect values in the extracted metadata.
• Risk: Low. This change is a refactor and a fix to the additional metadata gathered (added in #66781). As such, it does not affect compilation which does not request extraction of metadata conformances. For compilation that does request extraction of metadata conformances, the change is small in scope and replaces a fragile code-path with one that should be much more robust.
• Testing: Automated tests added to the compiler test suite.

… requirements

To reduce duplication of logic with other parts of the compiler, instead of destructuring the constraint type, write the requirements in the opaque type declaration's generic signature.
@artemcm artemcm requested a review from a team as a code owner July 5, 2023 17:30
@artemcm
Copy link
Contributor Author

artemcm commented Jul 5, 2023

@swift-ci test

@artemcm artemcm added swift 5.9 🍒 release cherry pick Flag: Release branch cherry picks labels Jul 5, 2023
@artemcm artemcm closed this Jul 5, 2023
@artemcm artemcm reopened this Jul 5, 2023
@artemcm
Copy link
Contributor Author

artemcm commented Jul 5, 2023

@swift-ci test

@artemcm artemcm merged commit 3c56626 into swiftlang:release/5.9 Jul 10, 2023
@artemcm artemcm deleted the 59SimplifyConstExtractOpaqueTypes branch July 10, 2023 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🍒 release cherry pick Flag: Release branch cherry picks swift 5.9

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants