Skip to content

Commit 7d40130

Browse files
authored
Merge pull request #6268 from slavapestov/missing-test-arglabel-bug
Add missing test for "Horrific simulation of Swift 3 bug with argumen…
2 parents 9cb2212 + f511fec commit 7d40130

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// RUN: %target-typecheck-verify-swift -swift-version 4
2+
3+
// SR-2505: "Call arguments did not match up" assertion
4+
5+
func sr_2505(_ a: Any) {} // expected-note {{}}
6+
sr_2505() // expected-error {{missing argument for parameter #1 in call}}
7+
sr_2505(a: 1) // expected-error {{extraneous argument label 'a:' in call}}
8+
sr_2505(1, 2) // expected-error {{extra argument in call}}
9+
sr_2505(a: 1, 2) // expected-error {{extra argument in call}}
10+
11+
struct C_2505 {
12+
init(_ arg: Any) {
13+
}
14+
}
15+
16+
protocol P_2505 {
17+
}
18+
19+
extension C_2505 {
20+
init<T>(from: [T]) where T: P_2505 {
21+
}
22+
}
23+
24+
class C2_2505: P_2505 {
25+
}
26+
27+
let c_2505 = C_2505(arg: [C2_2505()]) // expected-error {{argument labels '(arg:)' do not match any available overloads}} expected-note {{overloads for 'C_2505' exist}}
28+

0 commit comments

Comments
 (0)