Skip to content

[CSGen] Allow typed pattern to propagate its type to sub-pattern #31571

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 6, 2020

Conversation

xedin
Copy link
Contributor

@xedin xedin commented May 5, 2020

Currently we always generate a new type variable for any pattern
(represented as _ in the source), but in cases where it's a
sub-pattern of a typed pattern e.g. let _: Foo = ... it makes
more sense to pass a type to it directly otherwise type variable
allocated for any pattern gets disconnected from the rest of
the constraint system.

Currently we always generate a new type variable for any pattern
(represented as `_` in the source), but in cases where it's a
sub-pattern of a typed pattern e.g. `let _: Foo = ...` it makes
more sense to pass a type to it directly otherwise type variable
allocated for any pattern gets disconnected from the rest of
the constraint system.
@xedin xedin requested a review from DougGregor May 5, 2020 22:15
@xedin
Copy link
Contributor Author

xedin commented May 5, 2020

@swift-ci please smoke test

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.

Thanks!

@xedin xedin merged commit d1f79b1 into swiftlang:master May 6, 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