[QoI] Improve diagnostics for unresolved member with incorrect arguments

`FailureDiagnosis::visitUnresolvedMemberExpr` tries to use the same logic
as `diagnoseSingleCandidateFailures` so instead of doing that let's remove
some of the special handling and use `diagnoseSingleCandidateFailures`
directly instead, which improves label diagnostics and handles more erroneous
cases as well.

Resolves: rdar://problem/31898542
This commit is contained in:
Pavel Yaskevich
2017-05-11 01:31:33 -07:00
parent 0a0ab124e8
commit c0bc4f20be
3 changed files with 38 additions and 47 deletions

View File

@@ -26,3 +26,13 @@ class C2_2505: P_2505 {
let c_2505 = C_2505(arg: [C2_2505()]) // expected-error {{argument labels '(arg:)' do not match any available overloads}} expected-note {{overloads for 'C_2505' exist}}
// rdar://problem/31898542 - Swift 4: 'type of expression is ambiguous without more context' errors, without a fixit
enum R31898542<T> {
case success(T) // expected-note {{'success' declared here}}
case failure
}
func foo() -> R31898542<()> {
return .success() // expected-error {{missing argument for parameter #1 in call}} {{19-19=<#T#>}}
}