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 bc949c3 commit bdabde7Copy full SHA for bdabde7
test/Constraints/closures.swift
@@ -1267,3 +1267,19 @@ do {
1267
1268
// Currently legal.
1269
let _: () -> Int = { return fatalError() }
1270
+
1271
+// Make sure that `Void` assigned to closure result doesn't get eagerly propagated into the body
1272
+do {
1273
+ class C {
1274
+ func f(_: Any) -> Int! { fatalError() }
1275
+ static func f(_: Any) -> Int! { fatalError() }
1276
+ }
1277
1278
+ class G<T> {
1279
+ func g<U>(_ u: U, _: (U, T) -> ()) {}
1280
1281
+ func g<U: C>(_ u: U) {
1282
+ g(u) { $0.f($1) } // expected-warning {{result of call to 'f' is unused}}
1283
1284
1285
+}
0 commit comments