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.
1 parent 2704b6d commit 4c8f1c8Copy full SHA for 4c8f1c8
test/expr/closure/closures.swift
@@ -483,3 +483,24 @@ let closure = { // expected-error {{unable to infer complex closure return type;
483
var helper = true
484
return helper
485
}
486
+
487
+// SR-9839
488
+func SR9839(_ x: @escaping @convention(block) () -> Void) {}
489
490
+func id<T>(_ x: T) -> T {
491
+ return x
492
+}
493
494
+var qux: () -> Void = {}
495
496
+SR9839(qux)
497
+SR9839(id(qux)) // expected-error {{conflicting arguments to generic parameter 'T' ('() -> Void' vs. '@convention(block) () -> Void')}}
498
499
+func forceUnwrap<T>(_ x: T?) -> T {
500
+ return x!
501
502
503
+var qux1: (() -> Void)? = {}
504
505
+SR9839(qux1!)
506
+SR9839(forceUnwrap(qux1))
0 commit comments