Skip to content

[CSGen] Don't apply one-way requirement to typed patterns #38320

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
Jul 10, 2021

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Jul 8, 2021

Typed patterns are represented by a name and a fixed contextual
type, let's not use intermediary type variable and one-way constraint
as its type because that variable would be bound right away to
contextual type. Also setting type of a variable declaration
to a type variable when contextual type is IUO doesn't play well
with overload resolution because it expects an optional type for
declarations with IUO attribute.

Resolves: rdar://80271666

@xedin xedin requested a review from hborla July 8, 2021 21:59
@xedin
Copy link
Contributor Author

xedin commented Jul 9, 2021

@swift-ci please smoke test

Typed patterns are represented by a name and a fixed contextual
type, let's not use intermediary type variable and one-way constraint
as its type because that variable would be bound right away to
contextual type. Also setting type of a variable declaration
to a type variable when contextual type is IUO doesn't play well
with overload resolution because it expects an optional type for
declarations with IUO attribute.

Resolves: rdar://80271666
@xedin
Copy link
Contributor Author

xedin commented Jul 9, 2021

@swift-ci please smoke test

@xedin xedin merged commit 8a59c1e into swiftlang:main Jul 10, 2021
xedin added a commit to xedin/swift that referenced this pull request Jul 20, 2021
Follow-up for swiftlang#38320

Typed patterns no longer use an intermediary type variable,
which created a problem for references to variables declared
inside of a pattern because their types weren't recorded in
constraint system.

Resolves: rdar://80797176
xedin added a commit to xedin/swift that referenced this pull request Jul 20, 2021
Follow-up for swiftlang#38320

Typed patterns no longer use an intermediary type variable,
which created a problem for references to variables declared
inside of a pattern because their types weren't recorded in
constraint system.

Resolves: rdar://80797176
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