File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -6491,16 +6491,20 @@ bool FailureDiagnosis::visitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
6491
6491
6492
6492
// Depending on how we matched, produce tailored diagnostics.
6493
6493
switch (candidateInfo.closeness ) {
6494
+ case CC_SelfMismatch: // Self argument mismatches.
6495
+ llvm_unreachable (" These aren't produced by filterContextualMemberList" );
6496
+ return false ;
6497
+
6494
6498
case CC_NonLValueInOut: // First argument is inout but no lvalue present.
6495
6499
case CC_OneArgumentMismatch: // All arguments except one match.
6496
6500
case CC_OneArgumentNearMismatch:
6497
6501
case CC_OneGenericArgumentMismatch:
6498
6502
case CC_OneGenericArgumentNearMismatch:
6499
6503
case CC_GenericNonsubstitutableMismatch:
6500
- case CC_SelfMismatch: // Self argument mismatches.
6501
6504
case CC_ArgumentNearMismatch: // Argument list mismatch.
6502
6505
case CC_ArgumentMismatch: // Argument list mismatch.
6503
- llvm_unreachable (" These aren't produced by filterContextualMemberList" );
6506
+ // Candidate filtering can produce these now, but they can't
6507
+ // be properly diagnosed here at the moment.
6504
6508
return false ;
6505
6509
6506
6510
case CC_ExactMatch: { // This is a perfect match for the arguments.
Original file line number Diff line number Diff line change @@ -209,3 +209,14 @@ func rdar_45535925() {
209
209
// expected-error@-1 {{'bar' is inaccessible due to 'private' protection level}}
210
210
}
211
211
}
212
+
213
+ // rdar://problem/50668864
214
+ func rdar_50668864( ) {
215
+ struct Foo {
216
+ init ( anchors: [ Int ] ) {
217
+ // TODO: This would be improved when argument conversions are diagnosed via new diagnostic framework,
218
+ // actual problem here is that `[Int]` cannot be converted to function type represented by a closure.
219
+ self = . init { _ in [ ] } // expected-error {{type of expression is ambiguous without more context}}
220
+ }
221
+ }
222
+ }
You can’t perform that action at this time.
0 commit comments