Skip to content

Commit 5e615d6

Browse files
AnthonyLatsisCatfish-Man
authored andcommitted
Add regression test to close swiftlang#43509
1 parent a8d73b7 commit 5e615d6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/Constraints/argument_matching.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1789,3 +1789,16 @@ func rdar93922410(_ completion: (Int?) -> Void) { // expected-note {{'completion
17891789
return completion() // expected-error {{missing argument for parameter #1 in call}}
17901790
}
17911791
}
1792+
1793+
// https://github.com/apple/swift/issues/43509
1794+
do {
1795+
func myAssertionFailure(
1796+
_ message: @autoclosure () -> String = String(),
1797+
file: StaticString = #file, line: UInt = #line
1798+
) {}
1799+
1800+
let x: Int?
1801+
myAssertionFailure(x != nil, "error")
1802+
// expected-error@-1 {{cannot convert value of type 'Bool' to expected argument type 'String'}}
1803+
// expected-error@-2 {{missing argument label 'file:' in call}}
1804+
}

0 commit comments

Comments
 (0)