File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -5279,6 +5279,10 @@ bool FailureDiagnosis::visitApplyExpr(ApplyExpr *callExpr) {
5279
5279
argLabels))
5280
5280
return true ;
5281
5281
5282
+ // Diagnose some simple and common errors.
5283
+ if (calleeInfo.diagnoseSimpleErrors (callExpr))
5284
+ return true ;
5285
+
5282
5286
// Force recheck of the arg expression because we allowed unresolved types
5283
5287
// before, and that turned out not to help, and now we want any diagnoses
5284
5288
// from disallowing them.
@@ -5287,10 +5291,6 @@ bool FailureDiagnosis::visitApplyExpr(ApplyExpr *callExpr) {
5287
5291
if (!argExpr)
5288
5292
return true ; // already diagnosed.
5289
5293
5290
- // Diagnose some simple and common errors.
5291
- if (calleeInfo.diagnoseSimpleErrors (callExpr))
5292
- return true ;
5293
-
5294
5294
// A common error is to apply an operator that only has inout forms (e.g. +=)
5295
5295
// to non-lvalues (e.g. a local let). Produce a nice diagnostic for this
5296
5296
// case.
Original file line number Diff line number Diff line change @@ -54,10 +54,10 @@ _ = Foo() // expected-error {{'Foo' initializer is inaccessible due to 'internal
54
54
// <rdar://problem/27982012> QoI: Poor diagnostic for inaccessible initializer
55
55
struct rdar27982012 {
56
56
var x : Int
57
- private init ( _ x: Int ) { self . x = x }
57
+ private init ( _ x: Int ) { self . x = x } // expected-note {{'init' declared here}}
58
58
}
59
59
60
- _ = { rdar27982012 ( $0. 0 ) } ( ( 1 , 2 ) ) // expected-error {{type of expression is ambiguous without more context }}
60
+ _ = { rdar27982012 ( $0. 0 ) } ( ( 1 , 2 ) ) // expected-error {{initializer is inaccessible due to 'private' protection level }}
61
61
62
62
// TESTABLE-NOT: :[[@LINE-1]]:{{[^:]+}}:
63
63
_ = PrivateInit ( ) // expected-error {{'PrivateInit' initializer is inaccessible due to 'private' protection level}}
You can’t perform that action at this time.
0 commit comments