File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -180,3 +180,21 @@ func parentheticalInout2(_ fn: (((inout Int)), Int) -> ()) {
180
180
var value = 0
181
181
fn ( & value, 0 )
182
182
}
183
+
184
+ // SR-11724
185
+ // FIXME: None of these diagnostics is particularly good.
186
+ func bogusDestructuring( ) {
187
+ struct Bar { }
188
+
189
+ struct Foo {
190
+ func registerCallback( _ callback: @escaping ( [ Bar ] ) -> Void ) { } // expected-note {{found this candidate}}
191
+ func registerCallback( _ callback: @escaping ( [ String : Bar ] ) -> Void ) { } // expected-note {{found this candidate}}
192
+ func registerCallback( _ callback: @escaping ( Bar ? ) -> Void ) { } // expected-note {{found this candidate}}
193
+ }
194
+
195
+ Foo ( ) . registerCallback { ( [ Bar] ) in } // expected-error {{'<<error type>>' is not convertible to '[Bar]'}}
196
+ Foo ( ) . registerCallback { ( [ String: Bar] ) in } // expected-error {{'<<error type>>' is not convertible to '[Bar]'}}
197
+ Foo ( ) . registerCallback { ( Bar? ) in } // expected-error {{ambiguous use of 'registerCallback'}}
198
+ // expected-error@-1 {{expected parameter name followed by ':'}}
199
+ // expected-error@-2 {{expected ',' separator}}
200
+ }
You can’t perform that action at this time.
0 commit comments