Skip to content

Runtime: Fix metatype to mangling of function with single tuple-typed argument [5.0] #21156

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

Conversation

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Dec 9, 2018

This fixes converting a metatype to a readable string when the metatype is for a function type with a single tuple type argument.

Unfortunately the mangling for function types was never properly updated for the new post-SE-0110 representation, so there's a hack in ASTMangler. Preserve the hack on the runtime side.

Fixes https://bugs.swift.org/browse/SR-8235, rdar://problem/42134697.

While declaration mangling now does the right thing for parameter lists,
the function type mangling unfortunately still models the parameter list
as a single tuple node.

Change the runtime's behavior to match the AST mangler, which wraps
a single tuple-typed parameter in a tuple node, so that we can produce
different mangling trees for function types taking multiple arguments
versus a single tuple argument.
@slavapestov slavapestov requested a review from a team as a code owner December 9, 2018 05:01
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov slavapestov changed the title Runtime: Fix demangling of function with single tuple-typed argument [5.0] Runtime: Fix metatype to mangling of function with single tuple-typed argument [5.0] Dec 9, 2018
@AnnaZaks AnnaZaks merged commit f83ec0c into swiftlang:swift-5.0-branch Dec 9, 2018
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