Skip to content

IRGen: Consistently mangle 'associated type paths' without a generic signature #38304

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

Conversation

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Jul 8, 2021

Mangling uses a generic signature is used to shorten member types
to just a name where the protocol is unambiguous.

Unfortunately, in the particular case of 'associated type paths',
the IRGen mangler did not consistently set the right signature.

Sometimes, it would use no signature, and other times it would use
the signature of the concrete conforming type, which is incorrect
because the member type is written relative to the root protocol's
generic signature, <Self : P>.

This was caught by some new assertions I'm adding to the rewrite
system.

Note that this changes the mangling of a few symbols, but none
are public in the ABI.

…signature

Mangling uses a generic signature is used to shorten member types
to just a name where the protocol is unambiguous.

Unfortunately, in the particular case of 'associated type paths',
the IRGen mangler did not consistently set the right signature.

Sometimes, it would use no signature, and other times it would use
the signature of the concrete conforming type, which is incorrect
because the member type is written relative to the root protocol's
generic signature, <Self : P>.

This was caught by some new assertions I'm adding to the rewrite
system.

Note that this changes the mangling of a few symbols, but none
are public in the ABI.
@slavapestov slavapestov requested a review from jckarter July 8, 2021 03:26
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov slavapestov merged commit 306b185 into swiftlang:main Jul 8, 2021
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