Skip to content

[AST] Preserve source location in packIntoImplicitTupleOrParen #39522

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
Sep 30, 2021

Conversation

hamishknight
Copy link
Contributor

@hamishknight hamishknight commented Sep 30, 2021

Fix a crash introduced by the ArgumentList refactoring. When type-checking a tuple construction such as Void(), make sure to preserve the source info from the argument list in the resulting type-checked TupleExpr (). This is needed for serialization to be able to grab the textual representation.

Note that we still need to do more here to fully preserve the entire tuple construction expression in case the destination tuple type has important contextual information such as (Substring, Substring)("", ""). I've filed SR-15264 to track that, as I'm not entirely sure whether or not it has compatibility implications. This patch should at least get us back to the behavior prior to the ArgumentList refactoring though.

SR-15181
rdar://83202870

When type-checking a tuple construction such as
`Void()`, make sure to preserve the source info
from the argument list in the resulting
type-checked TupleExpr `()`. This is needed for
serialization to be able to grab the textual
representation.

SR-15181
rdar://83202870
@hamishknight
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@xymus xymus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thanks for the quick fix!

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