You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apple Swift version 5.1 (swiftlang-1100.0.270.13 clang-1100.0.33.7)
Target: x86_64-apple-darwin18.6.0
Additional Detail from JIRA
Votes
0
Component/s
Compiler
Labels
Bug
Assignee
None
Priority
Medium
md5: 67a57935eb77124209fdd9d2379004f1
duplicates:
SR-487 Compiler fails to consider @autoclosure when satisfying try requirements
Issue Description:
I have a test that checks that some processing function doesn't throw, and this function is called inside some "completion" like closure:
me.request{XCTAssertNoThrow(tryprocess($0))}
The problem is that compiler thinks that I'm trying to call `me.request` with throwing closure, and doesn't allow me to do so. While it's completely valid thing in regular function body, I think that's a bug.
Basic code to reproduce:
func request(_:()->Void){}func process()throws{}func check(_:@autoclosure()throws->Void){}// Invalid conversion// from throwing function of type '() throws -> ()'// to non-throwing function type '() -> Void'request{check(tryprocess())}// Completely validfunc foo(){check(tryprocess())}
The text was updated successfully, but these errors were encountered:
Environment
Apple Swift version 5.1 (swiftlang-1100.0.270.13 clang-1100.0.33.7)
Target: x86_64-apple-darwin18.6.0
Additional Detail from JIRA
md5: 67a57935eb77124209fdd9d2379004f1
duplicates:
Issue Description:
I have a test that checks that some processing function doesn't throw, and this function is called inside some "completion" like closure:
The problem is that compiler thinks that I'm trying to call `me.request` with throwing closure, and doesn't allow me to do so. While it's completely valid thing in regular function body, I think that's a bug.
Basic code to reproduce:
The text was updated successfully, but these errors were encountered: