We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 62c4036 + b05e52b commit 865dc0cCopy full SHA for 865dc0c
test/Constraints/closures.swift
@@ -858,3 +858,19 @@ func rdar45771997() {
858
let _: Int = { (s: inout S) in s.foo() }
859
// expected-error@-1 {{cannot convert value of type '(inout S) -> ()' to specified type 'Int'}}
860
}
861
+
862
+struct rdar30347997 {
863
+ func withUnsafeMutableBufferPointer(body : (inout Int) -> ()) {}
864
+ func foo() {
865
+ withUnsafeMutableBufferPointer {
866
+ (b : Int) in // expected-error {{'Int' is not convertible to 'inout Int'}}
867
+ }
868
869
+}
870
871
+struct rdar43866352<Options> {
872
873
+ let callback: (inout Options) -> Void
874
+ callback = { (options: Options) in } // expected-error {{cannot assign value of type '(inout Options) -> ()' to type '(inout _) -> Void'}}
875
876
0 commit comments