Skip to content

Adapt to Tuple-In-OptionalSome Patterns in Space Projection #31714

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
May 13, 2020

Conversation

CodaFi
Copy link
Contributor

@CodaFi CodaFi commented May 11, 2020

The space engine goes out of its way to rewrite OptionalSome patterns
using the postfix-? sugar into .some(...). Unfortunately, it performed
the following remapping:

(x, y, z, ...)? -> .some(x, y, z, ...)

This syntactic form used to behave correctly. However, we are no longer
flattening nested tuples so the correct rewrite is:

(x, y, z, ...)? -> .some((x, y, z, ...))

Correct this space projection rule.

rdar://62200966

@CodaFi
Copy link
Contributor Author

CodaFi commented May 11, 2020

@swift-ci test

@CodaFi
Copy link
Contributor Author

CodaFi commented May 11, 2020

@swift-ci test source compatibility

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 916005cf7f0244aa7986e55c664c89805a9fb248

The space engine goes out of its way to rewrite OptionalSome patterns
using the postfix-? sugar into .some(...). Unfortunately, it performed
the following remapping:

(x, y, z, ...)? -> .some(x, y, z, ...)

This syntactic form used to behave correctly. However, we are no longer
flattening nested tuples so the correct rewrite is:

(x, y, z, ...)? -> .some((x, y, z))

Correct this space projection rule.

rdar://62200966
@CodaFi
Copy link
Contributor Author

CodaFi commented May 13, 2020

@swift-ci smoke test

@CodaFi
Copy link
Contributor Author

CodaFi commented May 13, 2020

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