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
[SE-289] Adjust selection statements examples to match reality (#1730)
Examples made it look like `buildOptional` calls are injected
after enclosing `if` when it doesn't have an else, which is
incorrect - `buildOptional` happens inside the block and `else`
is synthesized by the result builder transform.
If `if` statement doesn't have a corresponding `else` block, like in our example, the result builder transform is going create one implicitly and inject a call to `buildOptional(.none)` as follows:
The second transformation pattern produces a balanced binary tree of injections into a single partial result in the enclosing block. It supports `if`-`else` and `switch`. Consider the following code:
@@ -443,13 +457,19 @@ Under this pattern, the example code becomes something like the following:
0 commit comments