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
// Lifetime specifiers before parameter names were disallowed in Swift 3 (SE-0031).
10
+
// `isolated`, `transferring` and `_const` got added after Swift 3 without a diagnostic
11
+
// to disallow them before parameter names.
12
+
13
+
func foo(inout x b:MyClass){} // expected-error {{'inout' before a parameter name is not allowed, place it before the parameter type instead}}
14
+
15
+
func foo(borrowing x b:MyClass){} // expected-error {{'borrowing' before a parameter name is not allowed, place it before the parameter type instead}}
16
+
17
+
@available(SwiftStdlib 5.1,*)
18
+
func foo(isolated x b:MyActor){} // expected-warning {{'isolated' before a parameter name is not allowed, place it before the parameter type instead; this is an error in the Swift 6 language mode}}
19
+
20
+
func foo(_const x b:MyClass){} // expected-warning {{'_const' before a parameter name is not allowed, place it before the parameter type instead; this is an error in the Swift 6 language mode}}
21
+
22
+
// expected-error@+3 {{expected ',' separator}}
23
+
// expected-error@+2 {{expected ':' following argument label and parameter name}}
func const_map_in_wrong_position(_const _ map:KeyPath<Article,String>){} // expected-warning {{'_const' before a parameter name is not allowed, place it before the parameter type instead; this is an error in the Swift 6 language mode}}
0 commit comments