Skip to content

[CSGen] Allow is patterns to infer type from enclosing context #32159

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
Jun 4, 2020

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Jun 3, 2020

Instead of assuming type of its sub-pattern is should be able
to infer type from context and then propagate that to the sub-pattern
via conversion. This enables support for patterns like .foo(_ as Foo)
where is would have a type different from _ which gets inferred
from associated value of foo and converted to Foo that becomes
a type of _ pattern.

Resolves: rdar://problem/63510989

Instead of assuming type of its sub-pattern `is` should be able
to infer type from context and then propagate that to the sub-pattern
via conversion. This enables support for patterns like `.foo(_ as Foo)`
where `is` would have a type different from `_` which gets inferred
from associated value of `foo` and converted to `Foo` that becomes
a type of `_` pattern.

Resolves: rdar://problem/63510989
@xedin xedin requested a review from DougGregor June 3, 2020 17:36
Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

Thank you!

@xedin
Copy link
Contributor Author

xedin commented Jun 3, 2020

@swift-ci please smoke test

@xedin
Copy link
Contributor Author

xedin commented Jun 3, 2020

@swift-ci please test source compatibility

@xedin
Copy link
Contributor Author

xedin commented Jun 3, 2020

@swift-ci please smoke test Windows platform

2 similar comments
@xedin
Copy link
Contributor Author

xedin commented Jun 3, 2020

@swift-ci please smoke test Windows platform

@xedin
Copy link
Contributor Author

xedin commented Jun 3, 2020

@swift-ci please smoke test Windows platform

@xedin
Copy link
Contributor Author

xedin commented Jun 4, 2020

Looks like ACHNBrowserUI failure is unrelated, merging.

error: could not find module 'UIImageColors' for target 'arm64-apple-ios'; found: armv7-apple-ios, arm, armv7
import UIImageColors

@xedin xedin merged commit 2f3a0f0 into swiftlang:master Jun 4, 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.

None yet

2 participants