Skip to content

[Diagnostics] Avoid relying on solution for contextual purpose information #36947

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 2 commits into from
Apr 26, 2021

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Apr 17, 2021

  • Augment ContextualType element to carry its purpose
  • Switch to use contextual purpose associated with locator

Both of these changes mean that diagnostics no longer need to
query a solution for contextual "purpose" associated with a
particular location, which benefits ContextualFailure and all
of its subtypes.

Resolves: rdar://68795727

@xedin xedin requested a review from hborla April 17, 2021 00:19
Copy link

@CertifiedRice CertifiedRice left a comment

Choose a reason for hiding this comment

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

it kinda good, but decent enough. Good Job
Looks good to me!

xedin added 2 commits April 26, 2021 09:51
…pose

Having purpose attached to the contextual type element makes it much
easier to diagnose contextual mismatches without involving constraint
system state.
`ContextualFailure` is the main beneficiary of additional information
associated with `ContextualType` element because it no longer has to
query solution for "purpose" of the contextual information.

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

xedin commented Apr 26, 2021

@swift-ci please smoke test

Copy link
Member

@hborla hborla left a comment

Choose a reason for hiding this comment

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

Awesome!

@xedin xedin merged commit 7377fff into swiftlang:main Apr 26, 2021
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.

3 participants