AstGen: add ResultLoc.only_break to fix loop's then-scope result
fix https://github.com/ziglang/zig/issues/12555 https://github.com/ziglang/zig/issues/12551 https://github.com/ziglang/zig/issues/12455
loop body is noreturn and only the break operands are the result values of loops. the new locType 'only_break' mean only effect break result,
otherwise it's work like 'none'.
ralate commit: https://github.com/ziglang/zig/commit/70894d5c2f
prev msg:
~while/for expr use func markAsLoopBody to set rvalue_noresult field for help func rvalue to skip store result in then_scope. and blockExpr default return void_value when block end_noreturn.~
~in this case, func rvalue add a as_node for rl if it is ty case, then got as_node(rl, void_value)cause the bug.~
~so need add rvalue_noresult case include ty rl~
PS: zig is great project.
I plan to solve this problem together https://github.com/ziglang/zig/issues/12455
it also ResultLoc problem.. then_scope must not return result, but still use break_loc.
maybe add a sub block if then_expr is not a block is simple way?
@Vexu give me a tip pls.
I don't know how that should be solved, I'd have to fix it myself to be able to help.
@Vexu done. 😊
@Vexu OMG, i take quite a long way round. i make new PR for the new simple way.https://github.com/ziglang/zig/pull/12850
i'm so sorry for wasting your time.