Skip to content
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

Merged
merged 30 commits into from
Oct 27, 2024

Conversation

fummicc1
Copy link
Collaborator

@fummicc1 fummicc1 commented Jun 30, 2024

In this PR, I fixed tiny bug to support typed throw for closure handler. Also, added some changes as nits.

@fummicc1 fummicc1 force-pushed the feature/issue-261-typed-throw branch from 136cdd3 to bbb6de0 Compare June 30, 2024 07:57
@fummicc1 fummicc1 force-pushed the feature/issue-261-typed-throw branch from c5c877f to 725c67d Compare July 15, 2024 01:26
Sources/MockoloFramework/Utils/TypeParser.swift Outdated Show resolved Hide resolved
Package.swift Outdated Show resolved Hide resolved
@fummicc1 fummicc1 marked this pull request as ready for review July 15, 2024 01:37
@fummicc1 fummicc1 requested review from sidepelican and uhooi July 15, 2024 01:37
@fummicc1 fummicc1 requested a review from sidepelican October 26, 2024 06:59
@fummicc1 fummicc1 marked this pull request as draft October 26, 2024 09:57
@fummicc1 fummicc1 marked this pull request as ready for review October 26, 2024 13:01
@fummicc1 fummicc1 changed the title Generate mock method with Typed Throw fix for TypedThrow Oct 26, 2024
@fummicc1 fummicc1 requested a review from sidepelican October 27, 2024 00:52
@uber uber deleted a comment from fummicc1 Oct 27, 2024
@@ -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()

Copy link
Collaborator

@sidepelican sidepelican Oct 27, 2024

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)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds nice! I fixed it in these 2 commits.

@fummicc1 fummicc1 requested a review from sidepelican October 27, 2024 13:58
@fummicc1 fummicc1 changed the title fix for TypedThrow Correct the throws clause in the closure within template logic to support TypedThrow. Oct 27, 2024
Copy link
Collaborator

@sidepelican sidepelican left a 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.

@sidepelican sidepelican merged commit 09a1ea2 into uber:master Oct 27, 2024
3 checks passed
@fummicc1 fummicc1 deleted the feature/issue-261-typed-throw branch October 27, 2024 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants