You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Parse] Provide a diagnostic when a closure parameter is declared with type sugar (#28315)
* diagnostic when a closure parameter is declared with type sugar
* Use a test that was already commmited for SR-11724
i
* Use isa<T> instead of asking for the kind directly
* Fix nit: Remove a whitespace
Copy file name to clipboardExpand all lines: test/decl/func/functions.swift
+7-8Lines changed: 7 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -58,14 +58,14 @@ func recover_colon_arrow_7() :Int { } // expected-error {{expected '->' after f
58
58
59
59
func recover_missing_body_1() // expected-error {{expected '{' in body of function declaration}}
60
60
func recover_missing_body_2() // expected-error {{expected '{' in body of function declaration}}
61
-
->Int
61
+
->Int
62
62
63
63
// Ensure that we don't skip over the 'func g' over to the right paren in
64
64
// function g, while recovering from parse error in f() parameter tuple. We
65
65
// should produce the error about missing right paren.
66
66
//
67
67
// FIXME: The errors are awful. We should produce just the error about paren.
68
-
func f_recover_missing_tuple_paren(_ a:Int // expected-note {{to match this opening '('}} expected-error{{expected '{' in body of function declaration}} expected-error {{expected ')' in parameter}}
68
+
func f_recover_missing_tuple_paren(_ a:Int // expected-note {{to match this opening '('}} expected-error{{expected '{' in body of function declaration}} expected-error {{expected ')' in parameter}}
69
69
func g_recover_missing_tuple_paren(_ b:Int){
70
70
}
71
71
@@ -187,14 +187,13 @@ func bogusDestructuring() {
187
187
structBar{}
188
188
189
189
structFoo{
190
-
func registerCallback(_ callback:@escaping([Bar])->Void){} // expected-note {{found this candidate}}
191
-
func registerCallback(_ callback:@escaping([String:Bar])->Void){} // expected-note {{found this candidate}}
192
-
func registerCallback(_ callback:@escaping(Bar?)->Void){} // expected-note {{found this candidate}}
0 commit comments