Skip to content

Commit 0d680aa

Browse files
committed
[TypeChecker] NFC: Add a counter-test example for SR-12033
1 parent 30bcdd9 commit 0d680aa

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/Constraints/closures.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,3 +1117,14 @@ struct SR12033_S {
11171117
Self.unwrap(o, { _ in .zero }) // expected-error {{contextual closure type '() -> U' expects 0 arguments, but 1 was used in closure body}}
11181118
}
11191119
}
1120+
1121+
// rdar://problem/74435602 - failure to infer a type for @autoclosure parameter.
1122+
func rdar_74435602(error: Error?) {
1123+
func accepts_autoclosure<T>(_ expression: @autoclosure () throws -> T) {}
1124+
1125+
accepts_autoclosure({
1126+
if let failure = error {
1127+
throw failure
1128+
}
1129+
})
1130+
}

0 commit comments

Comments
 (0)