Skip to content

Use Location of Inference Sources as a Fallback #58434

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
Apr 27, 2022

Conversation

CodaFi
Copy link
Contributor

@CodaFi CodaFi commented Apr 27, 2022

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 requested a review from hborla April 27, 2022 01:20
@CodaFi
Copy link
Contributor Author

CodaFi commented Apr 27, 2022

@swift-ci smoke test

@CodaFi CodaFi merged commit f34ad10 into swiftlang:main Apr 27, 2022
@CodaFi CodaFi deleted the conflicting-opinions branch April 27, 2022 05:12
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