Skip to content

[ConstraintSystem] Add a new locator element - argument attribute #31867

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 4 commits into from
May 19, 2020

Conversation

xedin
Copy link
Contributor

@xedin xedin commented May 18, 2020

ArgumentAttribute points to a particular attribute associated
with one of the arguments e.g. inout or its type e.g. @escaping.

This is very useful when dealing with argument-to-parameter
failures because it allows to express in the locator kind
of a problem.

ArgumentAttribute element is useful for new approach to ambiguity diagnostics
(#31713) because it makes it possible
to unambiguously point out that a certain failures are associated with an
argument to a call instead of a call itself.

xedin added 4 commits May 18, 2020 13:08
`ArgumentAttribute` points to a particular attribute associated
with one of the arguments e.g. `inout` or its type e.g. `@escaping`.

This is very useful when dealing with argument-to-parameter
failures because it allows to express in the locator kind
of a problem.
… handle `ArgumentAttribute`

- `getCalleeLocator`, if given locator ends at `ArgumentAttribute`
  strip the last element which makes sure that produced locator
  always refers directly to argument-to-parameter conversion.

- `simplifyLocator`, always leave `ArgumentAttribute` in the path
  because it's useful for diagnostics.
If either `MarkExplicitlyEscaping` or `TreatRValueAsLValue` fix
points to an argument-to-parameter conversion, let's add more
more clarifying argument to the locator to pinpoint the problem.
@xedin xedin requested a review from hborla May 18, 2020 20:18
@xedin
Copy link
Contributor Author

xedin commented May 19, 2020

@swift-ci please smoke test

@xedin xedin merged commit ca3aa67 into swiftlang:master May 19, 2020
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