result builder transform
Swift โฉ Attributes โฉ Result Builders โฉ
Canโt use break, continue, defer, guard(๐ โ), return, while, do-catch in the code (usaully the body of a closure) that a result builder transforms.
The transformation process doesnโt change declarations in the code, which lets you use temporary constants and variables to build up expressions piece by piece.
It also doesnโt change throw statements, compile-time diagnostic statements, or closures that contain a return statement.
An assignment (=) statement is transformed like an expression, but is understood to evaluate to ()
. You can define an overload of buildExpression(_:)
that takes an argument of type ()
to handle assignments specifically. ๐ Swift Reference
Last updated