Skip to content

[5.8][Diagnostics] Relax contextual type presence from assertion to a check #62843

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
Jan 5, 2023

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Jan 4, 2023

Cherry-pick of #62791


In some situations getContextualType for a contextual type locator
is going to return then empty type. This happens because e.g.
optional-some patterns and patterns with incorrect type don't have a
contextual type for initialization expression but use a conversion with
contextual locator nevertheless to indicate the purpose. This doesn't
affect non-ambiguity diagnostics because mismatches carry both
from and to types.

Resolves: rdar://problem/103739206
(cherry picked from commit eaf0532)

In some situations `getContextualType` for a contextual type
locator is going to return then empty type. This happens because
e.g. optional-some patterns and patterns with incorrect type don't
have a contextual type for initialization expression but use
a conversion with contextual locator nevertheless to indicate
the purpose. This doesn't affect non-ambiguity diagnostics
because mismatches carry both `from` and `to` types.

Resolves: rdar://problem/103739206
(cherry picked from commit eaf0532)
@xedin xedin added the r5.8 label Jan 4, 2023
@xedin xedin requested a review from hborla January 4, 2023 18:26
@xedin
Copy link
Contributor Author

xedin commented Jan 4, 2023

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Jan 5, 2023

@swift-ci please test macOS platform

@xedin xedin merged commit 0482af2 into swiftlang:release/5.8 Jan 5, 2023
@AnthonyLatsis AnthonyLatsis added 🍒 release cherry pick Flag: Release branch cherry picks swift 5.8 labels Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants