Skip to content

Fix nested bracket type overloading#349

Merged
sidepelican merged 6 commits into
uber:masterfrom
sidepelican:overloadingBracketType
May 7, 2026
Merged

Fix nested bracket type overloading#349
sidepelican merged 6 commits into
uber:masterfrom
sidepelican:overloadingBracketType

Conversation

@sidepelican
Copy link
Copy Markdown
Collaborator

Previously, mockolo fails to generate overloads for nested types like arrays.
Consider the following code, which only produces a single foo function for mock class.

    /// @mockable
    protocol P {
        func foo() -> [String]
        func foo() -> [[String]]
    }

The issue stems from SwiftType.displayName continuing to use a legacy ad-hoc implementation, resulting in both [String] and [[String]] being rendered as the same String.
I'll modify the implementation to properly construct displayName in a structured manner.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ sidepelican
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

@sidepelican sidepelican requested review from fummicc1 and uhooi May 1, 2026 09:02
Copy link
Copy Markdown
Collaborator

@uhooi uhooi left a comment

Choose a reason for hiding this comment

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

LGTM!!

@sidepelican
Copy link
Copy Markdown
Collaborator Author

Thank you all for your reviews

@sidepelican sidepelican merged commit 3774db4 into uber:master May 7, 2026
7 of 8 checks passed
@sidepelican sidepelican deleted the overloadingBracketType branch May 7, 2026 00:07
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.

5 participants