Skip to content

[Diagnostics] Improve simplifyLocator to extract arguments from unr… #18640

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
Aug 11, 2018

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Aug 10, 2018

…esolved member calls

Unresolved member calls e.g. .foo(1, 2) are unique in a way that
they don't form regular application expressions. So let's teach
simplifyLocator how to extract arguments from such calls
based on locators like:
[UnresolvedMemberExpr -> apply argument -> comparing call argument # to parameter #].

This helps to diagnose more failures via diagnostics attached to
constraint system fixes.

@xedin
Copy link
Contributor Author

xedin commented Aug 10, 2018

Diagnostic messages are going to be the same in both cases, but one example of affected expression is:

enum Color {
  static func frob(_ a : Int, b : inout Int) -> Color { ... }
}

var i : Int = 42
let _: Color = .frob(1, b: i) // diagnoses missing `&` at position of `i`.

…esolved member calls

Unresolved member calls e.g. `.foo(1, 2)` are unique in a way that
they don't form regular application expressions. So let's teach
`simplifyLocator` how to extract arguments from such calls
based on locators like:
`[UnresolvedMemberExpr -> apply argument -> comparing call argument # to parameter #]`.

This helps to diagnose more failures via diagnostics attached to
constraint system fixes.
@xedin xedin force-pushed the improve-simplify-locator branch from cbd9228 to 538e5e8 Compare August 10, 2018 23:31
@xedin
Copy link
Contributor Author

xedin commented Aug 10, 2018

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - cbd9228d3d7c02eada19fe24bca4d2545bd3b336

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - cbd9228d3d7c02eada19fe24bca4d2545bd3b336

@xedin
Copy link
Contributor Author

xedin commented Aug 11, 2018

@swift-ci please test source compatibility

@xedin xedin merged commit cd4909b into swiftlang:master Aug 11, 2018
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