| ... | @@ -880,7 +880,10 @@ fn expr(gz: *GenZir, scope: *Scope, ri: ResultInfo, node: Ast.Node.Index) InnerE | ... | @@ -880,7 +880,10 @@ fn expr(gz: *GenZir, scope: *Scope, ri: ResultInfo, node: Ast.Node.Index) InnerE |
| 880 | const start = try expr(gz, scope, .{ .rl = .{ .coerced_ty = .usize_type } }, lhs_extra.start); | 880 | const start = try expr(gz, scope, .{ .rl = .{ .coerced_ty = .usize_type } }, lhs_extra.start); |
| 881 | const cursor = maybeAdvanceSourceCursorToMainToken(gz, node); | 881 | const cursor = maybeAdvanceSourceCursorToMainToken(gz, node); |
| 882 | const len = try expr(gz, scope, .{ .rl = .{ .coerced_ty = .usize_type } }, full.ast.end.unwrap().?); | 882 | const len = try expr(gz, scope, .{ .rl = .{ .coerced_ty = .usize_type } }, full.ast.end.unwrap().?); |
| 883 | const sentinel = if (full.ast.sentinel.unwrap()) |sentinel| try expr(gz, scope, .{ .rl = .none }, sentinel) else .none; | 883 | const sentinel = if (full.ast.sentinel.unwrap()) |sentinel| s: { |
| | 884 | const sentinel_ty = try gz.addUnNode(.slice_sentinel_ty, lhs, node); |
| | 885 | break :s try expr(gz, scope, .{ .rl = .{ .coerced_ty = sentinel_ty } }, sentinel); |
| | 886 | } else .none; |
| 884 | try emitDbgStmt(gz, cursor); | 887 | try emitDbgStmt(gz, cursor); |
| 885 | const result = try gz.addPlNode(.slice_length, node, Zir.Inst.SliceLength{ | 888 | const result = try gz.addPlNode(.slice_length, node, Zir.Inst.SliceLength{ |
| 886 | .lhs = lhs, | 889 | .lhs = lhs, |