Skip to content

Commit 12c8630

Browse files
[tests] Adding regression tests for SR-13240
1 parent 8fe1e3c commit 12c8630

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/Constraints/argument_matching.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,3 +1623,18 @@ func sr13135() {
16231623

16241624
foo(Foo().bar, [baz])
16251625
}
1626+
1627+
// SR-13240
1628+
func twoargs(_ x: String, _ y: String) {}
1629+
1630+
func test() {
1631+
let x = 1
1632+
twoargs(x, x) // expected-error 2 {{cannot convert value of type 'Int' to expected argument type 'String'}}
1633+
}
1634+
1635+
infix operator ---
1636+
1637+
func --- (_ lhs: String, _ rhs: String) -> Bool { true }
1638+
1639+
let x = 1
1640+
x --- x // expected-error 2 {{cannot convert value of type 'Int' to expected argument type 'String'}}

0 commit comments

Comments
 (0)