Skip to content

Fix missing generic parameters in member type#341

Merged
sidepelican merged 1 commit intouber:masterfrom
sidepelican:fix_member_generic_types
Mar 24, 2026
Merged

Fix missing generic parameters in member type#341
sidepelican merged 1 commit intouber:masterfrom
sidepelican:fix_member_generic_types

Conversation

@sidepelican
Copy link
Copy Markdown
Collaborator

There was a problem where member types that held generic parameters would lose them.

  • base code
func bar<T: Body>() -> Swift.Result<T, any Error>
  • expected
    var barHandler: (() -> Any)?
    func bar<T: Body>() -> Swift.Result<T, any Error> {
        barCallCount += 1
        if let barHandler = barHandler {
            return barHandler() as! Swift.Result<T, any Error>
        }
        fatalError("barHandler returns can't have a default value thus its handler must be set")
    }
  • actual
    var barHandler: (() -> Swift.Result)?
    func bar<T: Body>() -> Swift.Result {
        barCallCount += 1
        if let barHandler = barHandler {
            return barHandler()
        }
        fatalError("barHandler returns can't have a default value thus its handler must be set")
    }

Thanks to @slightair !

@sidepelican sidepelican requested review from fummicc1 and uhooi March 24, 2026 08:31
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 sidepelican merged commit 0d06b13 into uber:master Mar 24, 2026
8 checks passed
@sidepelican sidepelican deleted the fix_member_generic_types branch March 24, 2026 08:58
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