| ... | @@ -6174,7 +6174,7 @@ fn ifExpr( | ... | @@ -6174,7 +6174,7 @@ fn ifExpr( |
| 6174 | .gen_zir = &then_scope, | 6174 | .gen_zir = &then_scope, |
| 6175 | .name = ident_name, | 6175 | .name = ident_name, |
| 6176 | .inst = payload_inst, | 6176 | .inst = payload_inst, |
| 6177 | .token_src = payload_token, | 6177 | .token_src = token_name_index, |
| 6178 | .id_cat = .capture, | 6178 | .id_cat = .capture, |
| 6179 | }; | 6179 | }; |
| 6180 | try then_scope.addDbgVar(.dbg_var_val, ident_name, payload_inst); | 6180 | try then_scope.addDbgVar(.dbg_var_val, ident_name, payload_inst); |
| ... | @@ -6415,19 +6415,18 @@ fn whileExpr( | ... | @@ -6415,19 +6415,18 @@ fn whileExpr( |
| 6415 | // will add this instruction to then_scope.instructions below | 6415 | // will add this instruction to then_scope.instructions below |
| 6416 | const payload_inst = try then_scope.makeUnNode(tag, cond.inst, while_full.ast.cond_expr); | 6416 | const payload_inst = try then_scope.makeUnNode(tag, cond.inst, while_full.ast.cond_expr); |
| 6417 | opt_payload_inst = payload_inst.toOptional(); | 6417 | opt_payload_inst = payload_inst.toOptional(); |
| 6418 | const ident_token = if (payload_is_ref) payload_token + 1 else payload_token; | 6418 | const ident_token = payload_token + @intFromBool(payload_is_ref); |
| 6419 | const ident_bytes = tree.tokenSlice(ident_token); | 6419 | const ident_bytes = tree.tokenSlice(ident_token); |
| 6420 | if (mem.eql(u8, "_", ident_bytes)) | 6420 | if (mem.eql(u8, "_", ident_bytes)) |
| 6421 | break :s &then_scope.base; | 6421 | break :s &then_scope.base; |
| 6422 | const payload_name_loc = payload_token + @intFromBool(payload_is_ref); | 6422 | const ident_name = try astgen.identAsString(ident_token); |
| 6423 | const ident_name = try astgen.identAsString(payload_name_loc); | 6423 | try astgen.detectLocalShadowing(&then_scope.base, ident_name, ident_token, ident_bytes, .capture); |
| 6424 | try astgen.detectLocalShadowing(&then_scope.base, ident_name, payload_name_loc, ident_bytes, .capture); | | |
| 6425 | payload_val_scope = .{ | 6424 | payload_val_scope = .{ |
| 6426 | .parent = &then_scope.base, | 6425 | .parent = &then_scope.base, |
| 6427 | .gen_zir = &then_scope, | 6426 | .gen_zir = &then_scope, |
| 6428 | .name = ident_name, | 6427 | .name = ident_name, |
| 6429 | .inst = payload_inst.toRef(), | 6428 | .inst = payload_inst.toRef(), |
| 6430 | .token_src = payload_token, | 6429 | .token_src = ident_token, |
| 6431 | .id_cat = .capture, | 6430 | .id_cat = .capture, |
| 6432 | }; | 6431 | }; |
| 6433 | dbg_var_name = ident_name; | 6432 | dbg_var_name = ident_name; |
| ... | @@ -7107,7 +7106,7 @@ fn switchExprErrUnion( | ... | @@ -7107,7 +7106,7 @@ fn switchExprErrUnion( |
| 7107 | .gen_zir = &case_scope, | 7106 | .gen_zir = &case_scope, |
| 7108 | .name = ident_name, | 7107 | .name = ident_name, |
| 7109 | .inst = unwrapped_payload, | 7108 | .inst = unwrapped_payload, |
| 7110 | .token_src = payload_token, | 7109 | .token_src = token_name_index, |
| 7111 | .id_cat = .capture, | 7110 | .id_cat = .capture, |
| 7112 | }; | 7111 | }; |
| 7113 | try case_scope.addDbgVar(.dbg_var_val, ident_name, unwrapped_payload); | 7112 | try case_scope.addDbgVar(.dbg_var_val, ident_name, unwrapped_payload); |
| ... | @@ -7667,7 +7666,7 @@ fn switchExpr( | ... | @@ -7667,7 +7666,7 @@ fn switchExpr( |
| 7667 | .gen_zir = &case_scope, | 7666 | .gen_zir = &case_scope, |
| 7668 | .name = capture_name, | 7667 | .name = capture_name, |
| 7669 | .inst = switch_block.toRef(), | 7668 | .inst = switch_block.toRef(), |
| 7670 | .token_src = payload_token, | 7669 | .token_src = ident, |
| 7671 | .id_cat = .capture, | 7670 | .id_cat = .capture, |
| 7672 | }; | 7671 | }; |
| 7673 | dbg_var_name = capture_name; | 7672 | dbg_var_name = capture_name; |