Skip to content

Commit 8b64ab2

Browse files
authored
Merge pull request #36023 from xedin/rdar-74435602
[TypeChecker] NFC: Add a counter-test example for SR-12033
2 parents 8a0e706 + 868fe50 commit 8b64ab2

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
@@ -1056,3 +1056,14 @@ func test_inout_with_invalid_member_ref() {
10561056
// expected-error@-1 {{value of tuple type 'Void' has no member 'createS'}}
10571057
// expected-error@-2 {{cannot pass immutable value as inout argument: '$0' is immutable}}
10581058
}
1059+
1060+
// rdar://problem/74435602 - failure to infer a type for @autoclosure parameter.
1061+
func rdar_74435602(error: Error?) {
1062+
func accepts_autoclosure<T>(_ expression: @autoclosure () throws -> T) {}
1063+
1064+
accepts_autoclosure({
1065+
if let failure = error {
1066+
throw failure
1067+
}
1068+
})
1069+
}

0 commit comments

Comments
 (0)