-
Notifications
You must be signed in to change notification settings - Fork 199
Fix typed throws #575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix typed throws #575
Conversation
| @@ -1,9 +1,21 @@ | |||
| struct StubError: Error {} | |||
|
|
|||
| class ClassWithTypedThrows { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this now generates:
override func typedThrows() throws(Error) -> Int? {
return try cuckoo_manager.callThrows(
"typedThrows() throws(Error) -> Int?",
parameters: (),
escapingParameters: (),
errorType: Error.self,
superclassCall: super.typedThrows(),
defaultCall: __defaultImplStub!.typedThrows()
)
}
override func genericWithTypedThrows<T> (_ p0: T) throws(StubError) {
return try cuckoo_manager.callThrows(
"genericWithTypedThrows<T> (_ p0: T) throws(StubError)",
parameters: (p0),
escapingParameters: (p0),
errorType: StubError.self,
superclassCall: super.genericWithTypedThrows(p0),
defaultCall: __defaultImplStub!.genericWithTypedThrows(p0)
)
}
override func asyncTypedThrow() async throws(Error) -> Int? {
return try await cuckoo_manager.callThrows(
"asyncTypedThrow() async throws(Error) -> Int?",
parameters: (),
escapingParameters: (),
errorType: Error.self,
superclassCall: await super.asyncTypedThrow(),
defaultCall: await __defaultImplStub!.asyncTypedThrow()
)
}
override func asyncGenericWithTypedThrows<T> (_ p0: T) async throws(StubError) {
return try await cuckoo_manager.callThrows(
"asyncGenericWithTypedThrows<T> (_ p0: T) async throws(StubError)",
parameters: (p0),
escapingParameters: (p0),
errorType: StubError.self,
superclassCall: await super.asyncGenericWithTypedThrows(p0),
defaultCall: await __defaultImplStub!.asyncGenericWithTypedThrows(p0)
)
}
override func untypedThrows() throws {
return try cuckoo_manager.callThrows(
"untypedThrows() throws",
parameters: (),
escapingParameters: (),
errorType: Swift.Error.self,
superclassCall: super.untypedThrows(),
defaultCall: __defaultImplStub!.untypedThrows()
)
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note that it correctly uses Error.self when needed but untypedThrows() uses Swift.Error.self instead
|
ci error seems unrelated to my change. likely this: actions/runner-images#12541 I've updated the simulator to 18.6 |
|
hey @MatyasKriz, would love to get some eyes on this when you have a minute :) |
|
Hey, I'm aware, but I couldn't find the time and now I'm vacationing, but I'll go through this when I return, promise! |
|
ah, my bad! sorry for interrupting your vacation, enjoy! :) |
|
Damn, and then I forgot about it. Sorry! Merging. |
Fixes the problems in #574