Skip to content

Convert SwinjectContainer generated argument registration functions to use parameter packs#314

Merged
skorulis-ap merged 1 commit intomainfrom
skorulis/parameter-packs-17
Feb 18, 2026
Merged

Convert SwinjectContainer generated argument registration functions to use parameter packs#314
skorulis-ap merged 1 commit intomainfrom
skorulis/parameter-packs-17

Conversation

@skorulis-ap
Copy link
Copy Markdown
Contributor

@skorulis-ap skorulis-ap commented Feb 16, 2026

This only does the first part of the migration to parameter packs as an experiment. I'm not seeing the same issues that I ran into last time.

I'll follow up this PR with one that migrates the rest of the ERB templates to parameter packs.

Tested using this branch in cash-ios with no issues: https://github.com/squareup/cash-ios/pull/77758

@skorulis-ap skorulis-ap force-pushed the skorulis/parameter-packs-17 branch from 6063a9c to af03d69 Compare February 17, 2026 05:47
@skorulis-ap skorulis-ap force-pushed the skorulis/parameter-packs-17 branch from af03d69 to b81a4d4 Compare February 17, 2026 06:19
Copy link
Copy Markdown
Contributor

@jszumski jszumski left a comment

Choose a reason for hiding this comment

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

Neat!

@skorulis-ap skorulis-ap marked this pull request as ready for review February 17, 2026 20:00
@skorulis-ap skorulis-ap requested a review from bradfol February 17, 2026 20:01
Copy link
Copy Markdown
Contributor

@bradfol bradfol left a comment

Choose a reason for hiding this comment

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

Awesome!

/// and returns the instance of the component type for the service.
///
/// - Returns: A registered `ServiceEntry` to configure more settings with method chaining.
@discardableResult public func register<Service, FirstArgument, each ArgumentType>(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Curious why is FirstArgument declared separately from the rest of the parameter pack?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's so the empty argument case still goes through the existing function without arguments. It might be possible to consolidate them, but I think I hit issues when trying that last time.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah yeah that makes sense

@skorulis-ap skorulis-ap merged commit b2a0504 into main Feb 18, 2026
4 of 7 checks passed
@skorulis-ap skorulis-ap deleted the skorulis/parameter-packs-17 branch February 18, 2026 23:30
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.

3 participants