It appears the second form is
Void, and it can be used anywhere the first form can. Except not in SwiftUI
What is the second form? Why is it allowed?
Edit: it appears the two expressions generate exactly the same instructions:
-O the two are just no-op with my test code.
all the more strange that
let _ = foo() is allowed in
ViewBuilder expression but not
_ = foo() if they are the same.
Anyone know what's going on? Is this an oversight with the
Edit 2: After reading the Language Reference:
_ is "Wildcard Expression", which can be used in many contexts.
_ = foo() // this is assignment, is not allowed in ResultBuilder expression let _ = foo() // this is `let` variable declaration, is allowed in ResultBuilder expression
Two different things.