Skip to content

Small fixes for new abstract conformance representation #80327

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 8 commits into from
Apr 1, 2025

Conversation

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Mar 27, 2025

  • ProtocolConformanceRef::subst() and ProtocolConformanceRef::mapConformanceOutOfContext() didn't handle abstract conformances with opaque result types in them correctly. We must now substitute the opaque result type and form a new abstract conformance, instead of returning the same one.
  • ProtocolConformanceRef::getAssociatedConformance() would return an abstract conformance with the original subject type and not the subject type of the requirement.
  • ReplaceOpaqueTypesWithUnderlyingTypes also required some fixes to deal with new abstract conformances.
  • Finally, rename TypeTransformer::transformSubMap() to transformSubstitutionMap(). Previously we weren't calling TypeSubstituter::transformSubstitutionMap(), and now we are. This exposed all of the above bugs.

@slavapestov slavapestov changed the title AST: Rename TypeTransform::transformSubMap() Small fixes for new abstract conformance representation Mar 28, 2025
@slavapestov slavapestov requested a review from jckarter as a code owner April 1, 2025 03:11
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@slavapestov slavapestov merged commit 3992fd9 into swiftlang:main Apr 1, 2025
5 checks passed
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.

2 participants