Skip to content

Commit 7fe0c86

Browse files
authored
Merge pull request swiftlang#30495 from LucianoPAlmeida/SR-8563-ambiguous-fixed-test-case
[tests] Adding SR-8563 test cases into the suit
2 parents dbe0cfa + 63c20bc commit 7fe0c86

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/expr/closure/inference.swift

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,25 @@ SR11540(action: { return }) // Ok SR11540<R>(action: () -> R) was the selected o
5151

5252
// In case that's the only possible overload, it's acceptable
5353
SR11540_1(action: { return }) // OK
54+
55+
// SR-8563
56+
func SR8563<A,Z>(_ f: @escaping (A) -> Z) -> (A) -> Z {
57+
return f
58+
}
59+
60+
func SR8563<A,B,Z>(_ f: @escaping (A, B) -> Z) -> (A, B) -> Z {
61+
return f
62+
}
63+
64+
let aa = SR8563 { (a: Int) in }
65+
let bb = SR8563 { (a1: Int, a2: String) in } // expected-note {{'bb' declared here}}
66+
67+
aa(1) // Ok
68+
bb(1, "2") // Ok
69+
bb(1) // expected-error {{missing argument for parameter #2 in call}}
70+
71+
// Tuple
72+
let cc = SR8563 { (_: (Int)) in }
73+
74+
cc((1)) // Ok
75+
cc(1) // Ok

0 commit comments

Comments
 (0)