| ... | @@ -6333,8 +6333,10 @@ fn ifExpr( | ... | @@ -6333,8 +6333,10 @@ fn ifExpr( |
| 6333 | const token_name_index = payload_token + @intFromBool(payload_is_ref); | 6333 | const token_name_index = payload_token + @intFromBool(payload_is_ref); |
| 6334 | const ident_name = try astgen.identAsString(token_name_index); | 6334 | const ident_name = try astgen.identAsString(token_name_index); |
| 6335 | const token_name_str = tree.tokenSlice(token_name_index); | 6335 | const token_name_str = tree.tokenSlice(token_name_index); |
| 6336 | if (mem.eql(u8, "_", token_name_str)) | 6336 | if (mem.eql(u8, "_", token_name_str)) { |
| | 6337 | if (payload_is_ref) return astgen.failTok(payload_token, "pointer modifier invalid on discard", .{}); |
| 6337 | break :s &then_scope.base; | 6338 | break :s &then_scope.base; |
| | 6339 | } |
| 6338 | try astgen.detectLocalShadowing(&then_scope.base, ident_name, token_name_index, token_name_str, .capture); | 6340 | try astgen.detectLocalShadowing(&then_scope.base, ident_name, token_name_index, token_name_str, .capture); |
| 6339 | payload_val_scope = .{ | 6341 | payload_val_scope = .{ |
| 6340 | .parent = &then_scope.base, | 6342 | .parent = &then_scope.base, |
| ... | @@ -6357,8 +6359,10 @@ fn ifExpr( | ... | @@ -6357,8 +6359,10 @@ fn ifExpr( |
| 6357 | else | 6359 | else |
| 6358 | .optional_payload_unsafe; | 6360 | .optional_payload_unsafe; |
| 6359 | const ident_bytes = tree.tokenSlice(ident_token); | 6361 | const ident_bytes = tree.tokenSlice(ident_token); |
| 6360 | if (mem.eql(u8, "_", ident_bytes)) | 6362 | if (mem.eql(u8, "_", ident_bytes)) { |
| | 6363 | if (payload_is_ref) return astgen.failTok(payload_token, "pointer modifier invalid on discard", .{}); |
| 6361 | break :s &then_scope.base; | 6364 | break :s &then_scope.base; |
| | 6365 | } |
| 6362 | const payload_inst = try then_scope.addUnNode(tag, cond.inst, then_node); | 6366 | const payload_inst = try then_scope.addUnNode(tag, cond.inst, then_node); |
| 6363 | const ident_name = try astgen.identAsString(ident_token); | 6367 | const ident_name = try astgen.identAsString(ident_token); |
| 6364 | try astgen.detectLocalShadowing(&then_scope.base, ident_name, ident_token, ident_bytes, .capture); | 6368 | try astgen.detectLocalShadowing(&then_scope.base, ident_name, ident_token, ident_bytes, .capture); |
| ... | @@ -6581,8 +6585,10 @@ fn whileExpr( | ... | @@ -6581,8 +6585,10 @@ fn whileExpr( |
| 6581 | opt_payload_inst = payload_inst.toOptional(); | 6585 | opt_payload_inst = payload_inst.toOptional(); |
| 6582 | const ident_token = payload_token + @intFromBool(payload_is_ref); | 6586 | const ident_token = payload_token + @intFromBool(payload_is_ref); |
| 6583 | const ident_bytes = tree.tokenSlice(ident_token); | 6587 | const ident_bytes = tree.tokenSlice(ident_token); |
| 6584 | if (mem.eql(u8, "_", ident_bytes)) | 6588 | if (mem.eql(u8, "_", ident_bytes)) { |
| | 6589 | if (payload_is_ref) return astgen.failTok(payload_token, "pointer modifier invalid on discard", .{}); |
| 6585 | break :s &then_scope.base; | 6590 | break :s &then_scope.base; |
| | 6591 | } |
| 6586 | const ident_name = try astgen.identAsString(ident_token); | 6592 | const ident_name = try astgen.identAsString(ident_token); |
| 6587 | try astgen.detectLocalShadowing(&then_scope.base, ident_name, ident_token, ident_bytes, .capture); | 6593 | try astgen.detectLocalShadowing(&then_scope.base, ident_name, ident_token, ident_bytes, .capture); |
| 6588 | payload_val_scope = .{ | 6594 | payload_val_scope = .{ |
| ... | @@ -6611,8 +6617,10 @@ fn whileExpr( | ... | @@ -6611,8 +6617,10 @@ fn whileExpr( |
| 6611 | opt_payload_inst = payload_inst.toOptional(); | 6617 | opt_payload_inst = payload_inst.toOptional(); |
| 6612 | const ident_name = try astgen.identAsString(ident_token); | 6618 | const ident_name = try astgen.identAsString(ident_token); |
| 6613 | const ident_bytes = tree.tokenSlice(ident_token); | 6619 | const ident_bytes = tree.tokenSlice(ident_token); |
| 6614 | if (mem.eql(u8, "_", ident_bytes)) | 6620 | if (mem.eql(u8, "_", ident_bytes)) { |
| | 6621 | if (payload_is_ref) return astgen.failTok(payload_token, "pointer modifier invalid on discard", .{}); |
| 6615 | break :s &then_scope.base; | 6622 | break :s &then_scope.base; |
| | 6623 | } |
| 6616 | try astgen.detectLocalShadowing(&then_scope.base, ident_name, ident_token, ident_bytes, .capture); | 6624 | try astgen.detectLocalShadowing(&then_scope.base, ident_name, ident_token, ident_bytes, .capture); |
| 6617 | payload_val_scope = .{ | 6625 | payload_val_scope = .{ |
| 6618 | .parent = &then_scope.base, | 6626 | .parent = &then_scope.base, |