Skip to content

[5.7] Use Location of Inference Sources as a Fallback #58665

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 4, 2022

Conversation

CodaFi
Copy link
Contributor

@CodaFi CodaFi commented May 4, 2022

Cherry picked from #58434


It's possible for the requirement machine to fail to pick up a source location for its computed errors to attach to when

  1. The declaration has no where clause
  2. Nor does it have a generic parameter list

This is possible because of the magic of desugaring opaque types in input position to generic parameters a la

func foo(_ : some P<T, U>)

Try to use the first valid user-written inference source to derive a location.

rdar://92105516

It's possible for the requirement machine to fail to pick up a source location for its computed errors to attach to when
1) The declaration has no where clause
2) Nor does it have a generic parameter list

This is possible because of the magic of desugaring opaque types in input position to generic parameters a la

func foo(_ : some P<T, U>)

Try to use the first valid user-written inference source to derive a location.

rdar://92105516
@CodaFi CodaFi added the r5.7 label May 4, 2022
@CodaFi CodaFi requested a review from hborla May 4, 2022 17:10
@CodaFi CodaFi requested a review from a team as a code owner May 4, 2022 17:10
@CodaFi
Copy link
Contributor Author

CodaFi commented May 4, 2022

@swift-ci test

@CodaFi CodaFi merged commit fc30104 into swiftlang:release/5.7 May 4, 2022
@CodaFi CodaFi deleted the location-location-location branch May 4, 2022 21:15
@AnthonyLatsis AnthonyLatsis added 🍒 release cherry pick Flag: Release branch cherry picks swift 5.7 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 swift 5.7
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants