Repository navigation
Conversation
calda
force-pushed
the
cal--infer-result-builder-generics
branch
6 times, most recently
from
December 26, 2025 20:19
7d28973 to
bb0a46e
Compare
calda
force-pushed
the
cal--infer-result-builder-generics
branch
2 times, most recently
from
January 4, 2026 16:26
51361df to
05f7fef
Compare
calda
force-pushed
the
cal--infer-result-builder-generics
branch
2 times, most recently
from
March 13, 2026 15:45
5266f5f to
76cd5fd
Compare
This reverts commit a96372f.
…ad, use the type as-written in the result builder transform, and rely on type inference within the transformed result.
calda
force-pushed
the
cal--infer-result-builder-generics
branch
from
November 12, 2026 02:54
76cd5fd to
f87ce1d
Compare
calda
commented
Nov 12, 2026
calda
force-pushed
the
cal--infer-result-builder-generics
branch
from
November 13, 2026 19:02
ecac350 to
b23c860
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Swift evolution proposal: [SE-0566] Infer generic arguments of result builder attributes
This PR adds support for inferring generic arguments of result builder attributes.
For example, this sample code was previously rejected with the error
"reference to generic type 'ArrayBuilder' requires arguments in <...>", but it now compiles successfully.The idea is that we resolve the generic arguments of the result builder type by type checking type-checking the expression
Builder.buildFinalResult(orbuildPartialBlock/buildBlock, based on the standard result builder precedence rules) against the type(_) -> Result, whereResultis the return type of the declaration the result builder is attached to.So, when we solve
ArrayBuilder.buildBlockwith the type(_) -> [String], the solver tells us thatArrayBuilder.Element == String.Solving the constraint in this way ensures we get standard overload resolution behavior in cases where there are multiple valid options for
buildFinalResult(etc).