Skip to content

Retain SE-0348 result builder methods (buildPartialBlock)#1140

Open
JOyo246 wants to merge 1 commit into
peripheryapp:masterfrom
JOyo246:fix/result-builder-se0348-partial-block
Open

Retain SE-0348 result builder methods (buildPartialBlock)#1140
JOyo246 wants to merge 1 commit into
peripheryapp:masterfrom
JOyo246:fix/result-builder-se0348-partial-block

Conversation

@JOyo246

@JOyo246 JOyo246 commented Jun 22, 2026

Copy link
Copy Markdown

Problem

Swift 5.7 introduced SE-0348 which added two new optional static methods to the result builder protocol:

  • buildPartialBlock(first:)
  • buildPartialBlock(accumulated:next:)

These are a more expressive alternative to buildBlock for incrementally combining components. Because they weren't listed in ResultBuilderRetainer, Periphery reported them as unused — a false positive for any result builder that adopts the SE-0348 API.

Fix

Added both method names to the resultBuilderMethods set in ResultBuilderRetainer.swift, added implementations to the retention fixture, and added assertions to the existing testRetainsResultBuilderMethods test.

Testing

  • Extended FixtureClass130 in testRetainsResultBuilderMethods.swift with both buildPartialBlock variants
  • Added assertReferenced assertions in RetentionTest.testRetainsResultBuilderMethods()

…uildPartialBlock(accumulated:next:)

Swift 5.7 (SE-0348) added two new result builder protocol methods as an
incremental-building alternative to buildBlock. Periphery was not
retaining them, causing false positives for any result builder that
implements the SE-0348 API surface.
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