|
1 | 1 | // RUN: %target-swift-frontend -module-name TestModule -parse -verify %s
|
2 | 2 |
|
3 | 3 | // Function type with various forms of argument label.
|
4 |
| -typealias Function1 = (a: Int, // expected-error{{function types cannot have argument label 'a'; use '_' instead}}{{24-24=_ }} |
| 4 | +typealias Function1 = (a: Int, // expected-error{{function types cannot have argument labels; use '_' before 'a'}}{{24-24=_ }} |
5 | 5 | _ b: Int, // okay
|
6 |
| - c d: Int, // expected-error{{function types cannot have argument label 'c'; use '_' instead}}{{24-25=_}} |
7 |
| - e _: Int, // expected-error{{function types cannot have argument label 'e'; use '_' instead}}{{24-29=}} |
| 6 | + c d: Int, // expected-error{{function types cannot have argument labels; use '_' before 'c'}}{{24-25=_}} |
| 7 | + e _: Int, // expected-error{{function types cannot have argument labels; use '_' before 'e'}}{{24-29=}} |
8 | 8 | _: Int, // okay
|
9 | 9 | Int) // okay
|
10 | 10 | -> Int
|
11 | 11 |
|
12 | 12 | // Throwing versions.
|
13 |
| -typealias Function2 = (a: Int, // expected-error{{function types cannot have argument label 'a'; use '_' instead}}{{24-24=_ }} |
| 13 | +typealias Function2 = (a: Int, // expected-error{{function types cannot have argument labels; use '_' before 'a'}}{{24-24=_ }} |
14 | 14 | _ b: Int, // okay
|
15 |
| - c d: Int, // expected-error{{function types cannot have argument label 'c'; use '_' instead}}{{24-25=_}} |
16 |
| - e _: Int, // expected-error{{function types cannot have argument label 'e'; use '_' instead}}{{24-29=}} |
| 15 | + c d: Int, // expected-error{{function types cannot have argument labels; use '_' before 'c'}}{{24-25=_}} |
| 16 | + e _: Int, // expected-error{{function types cannot have argument labels; use '_' before 'e'}}{{24-29=}} |
17 | 17 | _: Int, // okay
|
18 | 18 | Int) // okay
|
19 | 19 | throws -> Int
|
20 | 20 |
|
21 |
| -typealias Function3 = (a: Int, // expected-error{{function types cannot have argument label 'a'; use '_' instead}}{{24-24=_ }} |
| 21 | +typealias Function3 = (a: Int, // expected-error{{function types cannot have argument labels; use '_' before 'a'}}{{24-24=_ }} |
22 | 22 | _ b: Int, // okay
|
23 |
| - c d: Int, // expected-error{{function types cannot have argument label 'c'; use '_' instead}}{{24-25=_}} |
24 |
| - e _: Int, // expected-error{{function types cannot have argument label 'e'; use '_' instead}}{{24-29=}} |
| 23 | + c d: Int, // expected-error{{function types cannot have argument labels; use '_' before 'c'}}{{24-25=_}} |
| 24 | + e _: Int, // expected-error{{function types cannot have argument labels; use '_' before 'e'}}{{24-29=}} |
25 | 25 | _: Int, // okay
|
26 | 26 | Int) // okay
|
27 | 27 | rethrows -> Int // expected-error{{only function declarations may be marked 'rethrows'}}
|
|
0 commit comments