custom result-builder attributes

Swift โŸฉ Attributes โŸฉ Result Builders โŸฉ

Creating a result builder type creates a custom attribute with the same name.

custom attribute can be applied on:

  • function declaration:

  • variable/subscript declaration that includes a getter:

  • closure parameter in a function declaration:

the result builder builds the body of the function/getter/closure.

  • Applying a result builder attribute doesnโ€™t impact ABI compatibility.

  • Applying a result builder attribute to a parameter does make that attribute part of the functionโ€™s interface, which can effect source compatibility.

Last updated