Skip to content

Implicit tuple interpolations, take two #17195

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 2 commits into from
Jun 18, 2018
Merged

Implicit tuple interpolations, take two #17195

merged 2 commits into from
Jun 18, 2018

Conversation

beccadax
Copy link
Contributor

@beccadax beccadax commented Jun 14, 2018

When the parser encounters a "weird" string interpolation, like \(x, y) or \(foo: x), it sometimes produces a TupleExpr instead of a ParenExpr. This change wraps any such TupleExprs in ParenExprs to keep them from being interpreted as argument lists. This doesn't stop us from getting strange nodes like single-expression labeled tuples, but at least they're strange in ways that the compiler can cope with, and unlike #17074, this solution doesn't appear to cause any source breakage.

I'll post on Evolution soon about how to deal with these interpolations on a more permanent basis.

Resolves SR-7958 (again).

cc @CodaFi

Keeps them from being interpreted as parameter lists. Fixes SR-7958.
@beccadax beccadax changed the title Implicit tuples, take two Implicit tuple interpolations, take two Jun 14, 2018
@slavapestov
Copy link
Contributor

Thanks!

@slavapestov
Copy link
Contributor

@swift-ci Please smoke test

Lesson learned: the script is not infallible.
@beccadax
Copy link
Contributor Author

Mind running that again? I guess I shouldn't put too much faith in the resolve-crashes script.

@CodaFi
Copy link
Contributor

CodaFi commented Jun 15, 2018

resolve-crashes could be a bit smarter here, definitely.

@swift-ci please smoke test

@CodaFi
Copy link
Contributor

CodaFi commented Jun 18, 2018

@swift-ci please test source compatibility

@CodaFi
Copy link
Contributor

CodaFi commented Jun 18, 2018

Let's try this again

⛵️

@CodaFi CodaFi merged commit 0b33a69 into swiftlang:master Jun 18, 2018
@beccadax beccadax deleted the label-fable branch June 18, 2018 23:31
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.

3 participants