Skip to content

Commit 5802f2e

Browse files
Add regression tests to SR-14869
1 parent 0a10736 commit 5802f2e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/Constraints/function_conversion.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,12 @@ func rdar_59703585() {
8181
cb = swiftCallback
8282
// expected-error@-1 {{cannot assign value of type '(UnsafePointer<Int8>, UnsafeMutableRawPointer?) -> ()' to type 'Fn?' (aka 'Optional<@convention(c) (Optional<UnsafePointer<Int8>>, Optional<UnsafeMutableRawPointer>) -> ()>')}}
8383
}
84+
85+
// SR-14869
86+
var v1: (inout Float) -> ()
87+
v1 = { (_: inout Int) in }
88+
// expected-error@-1{{cannot assign value of type '(inout Int) -> ()' to type '(inout Float) -> ()'}}
89+
90+
var v2: (Int , inout Float) -> ()
91+
v2 = { (_: Int, _: inout Int) in }
92+
// expected-error@-1{{cannot assign value of type '(Int, inout Int) -> ()' to type '(Int, inout Float) -> ()'}}

0 commit comments

Comments
 (0)