You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While RegistrationBuilder does technically satisfy these requirements, it does not reference Component or FinalResult directly. If the type aliases are changed, the functions will no longer match.
Feature Request
The static methods of RegistrationBuilder should be updated to reference Component and/or FinalResult as applicable, rather than [Registration]. Additionally, the last overload of buildExpression(_:) (where S.Element == Registration) should be changed to return .init(expression) or return Component(expression), rather than referencing Array explicitly.
In line with these changes, perhaps the method signature of Factory.register(builder:) should be updated as well, to register(@RegistrationBuilder builder: () -> RegistrationBuilder.FinalResult).
Value
This change would put RegistrationBuilder more closely in line with the documentation for result builders, and reduce the amount of work necessary in the future should the types be changed.
The text was updated successfully, but these errors were encountered:
Checklist
Problem
The documentation for result builders lists the following methods:
buildBlock(_ components: Component...) -> Component
buildOptional(_ component: Component?) -> Component
buildEither(first: Component) -> Component
andbuildEither(second: Component) -> Component
buildArray(_ components: [Component]) -> Component
buildExpression(_ expression: Expression) -> Component
buildFinalResult(_ component: Component) -> FinalResult
While
RegistrationBuilder
does technically satisfy these requirements, it does not referenceComponent
orFinalResult
directly. If the type aliases are changed, the functions will no longer match.Feature Request
The static methods of
RegistrationBuilder
should be updated to referenceComponent
and/orFinalResult
as applicable, rather than[Registration]
. Additionally, the last overload ofbuildExpression(_:)
(where S.Element == Registration
) should be changed toreturn .init(expression)
orreturn Component(expression)
, rather than referencingArray
explicitly.In line with these changes, perhaps the method signature of
Factory.register(builder:)
should be updated as well, toregister(@RegistrationBuilder builder: () -> RegistrationBuilder.FinalResult)
.Value
This change would put
RegistrationBuilder
more closely in line with the documentation for result builders, and reduce the amount of work necessary in the future should the types be changed.The text was updated successfully, but these errors were encountered: