Skip to content

family member container parameter fix#109

Merged
ctreffs merged 5 commits intomasterfrom
family-member-container-parameter-fix
Feb 14, 2026
Merged

family member container parameter fix#109
ctreffs merged 5 commits intomasterfrom
family-member-container-parameter-fix

Conversation

@ctreffs
Copy link
Member

@ctreffs ctreffs commented Feb 14, 2026

Description

This PR refines the Parameter Pack implementation by addressing naming inconsistencies and shadowing issues in FamilyMemberContainer. It also marks the completion of the parameter_packs_20260213 track.

Rationale:

  • Unify the API for FamilyMemberContainer to use plural components: for all initializers.
  • Resolve shadowing of the components property which caused build failures when swiftformat removed explicit self. prefixes.

Detailed Design

Updated FamilyMemberContainer initializers:

public struct FamilyMemberContainer<each C: Component> {
    public let components: [(repeat each C)]

    public init(components: (repeat each C)...) { ... }

    // Renamed internal parameter to 'sequence' to avoid shadowing 'components'
    public init<S>(components sequence: S) where S: Sequence, S.Element == (repeat each C) {
        components = Array(sequence)
    }

    // Renamed internal parameter to 'iterator' to avoid shadowing 'components'
    public init(components iterator: Family<repeat each C>.ComponentsIterator) {
        components = Array(iterator)
    }
}

Documentation

  • Updated symbol-level documentation for FamilyMemberContainer initializers.
  • Documentation follows existing DocC standards.

Testing

  • Verified with FamilyCodingTests.swift.
  • All 138 tests in the suite passed.
  • Ran make pre-commit to ensure linting and formatting are correct.

Performance

  • No performance impact expected as these are naming and shadowing fixes in the coding layer.

Source Impact

  • Minor source-breaking change for anyone using the (previously singular) component: parameter name in the sequence initializer. However, this aligns it with the rest of the API.

Checklist

  • I've read the Contribution Guidelines
  • I've followed the coding style of the rest of the project.
  • I've added tests covering all new code paths my change adds to the project (to the extent possible).
  • I've added benchmarks covering new functionality (if appropriate).
  • I've verified that my change does not break any existing tests or introduce unexpected benchmark regressions.
  • I've updated the documentation (if appropriate).

@ctreffs ctreffs self-assigned this Feb 14, 2026
@ctreffs ctreffs marked this pull request as ready for review February 14, 2026 05:23
@ctreffs ctreffs enabled auto-merge (squash) February 14, 2026 05:24
@ctreffs ctreffs merged commit 07eadc4 into master Feb 14, 2026
11 of 14 checks passed
@ctreffs ctreffs deleted the family-member-container-parameter-fix branch February 14, 2026 05:34
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.

1 participant