We have so many issues with structured concurrency related to defer and branch
Also excluding the fact that it is confusing and hard to remember specifically each case if is a bug or intendeed…
Can you place defer statements inside that branch and the block, to check if they run?
Defer and Branch should have the same “scope rules” as mentioned on this page above.
If defer prints but branch is kept running, then I have no idea. If the defer does not print, something is wrong with the way the verse handles the logic
This is confusing, why does defer consider blocks a new enclosing scope, but branch does not?
We have issues for so long related to these conflicts. On the past, different epic devs also gave different answers when me and others made related questions.
Looks like there is no common consensus about how they should work…
This section on the book talking about scopes was made after a talk that I had with the language devs related to these complains, with the goal of making clear and easy to consult if we get confused by it.
In a perfect scenario, we would be able to “attach” the defer/branch to where we want (function scope, block scope, etc). But we can’t do that, and when we make bug reports of it about both behaviors, they get both closed which is clearly weird. How can they be both “correct” and both “wrong” at same time?