-
Notifications
You must be signed in to change notification settings - Fork 86
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
Correct the throws
clause in the closure within template logic to support TypedThrow.
#262
Correct the throws
clause in the closure within template logic to support TypedThrow.
#262
Conversation
136cdd3
to
bbb6de0
Compare
c5c877f
to
725c67d
Compare
Co-authored-by: Iceman <side.junktown@gmail.com>
Sources/MockoloFramework/Templates/FunctionSuffixTemplate.swift
Outdated
Show resolved
Hide resolved
@@ -566,7 +566,7 @@ public final class SwiftType { | |||
|
|||
let suffixStr = [ | |||
isAsync ? String.async + " " : nil, | |||
throwing.hasError ? String.throws + " " : nil, | |||
throwing != .none ? throwing.applyThrowingTemplate()! + " " : nil, | |||
].compactMap { $0 }.joined() | |||
|
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.
It want to avoid relying on internal implementations.
let suffixStr = [
isAsync ? String.async : nil,
throwing.applyThrowingTemplate(),
].compactMap { $0 }.joined(separator: " ") + " "
(This snippet exists in the other 2 places. Maybe it's a time to add utility, not must)
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.
throws
clause in the closure within template logic to support TypedThrow.
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.
Looks good. Nice work! thank you.
In this PR, I fixed tiny bug to support typed throw for closure handler. Also, added some changes as nits.