@@ -885,7 +885,7 @@ fn expr(gz: *GenZir, scope: *Scope, ri: ResultInfo, node: Ast.Node.Index) InnerE
885885 const lhs_is_slice_sentinel = lhs_tag == .slice_sentinel;
886886 const lhs_is_open_slice = lhs_tag == .slice_open or
887887 (lhs_is_slice_sentinel and tree.fullSlice(full.ast.sliced).?.ast.end == 0);
888- if (node_tags[node] != .slice_open and
888+ if (full.ast.end != 0 and
889889 lhs_is_open_slice and
890890 nodeIsTriviallyZero(tree, full.ast.start))
891891 {
@@ -897,7 +897,7 @@ fn expr(gz: *GenZir, scope: *Scope, ri: ResultInfo, node: Ast.Node.Index) InnerE
897897 } else try expr(gz, scope, .{ .rl = .{ .coerced_ty = .usize_type } }, node_datas[full.ast.sliced].rhs);
898898
899899 const cursor = maybeAdvanceSourceCursorToMainToken(gz, node);
900- const len = if (full.ast.end != 0) try expr(gz, scope, .{ .rl = .{ .coerced_ty = .usize_type } }, full.ast.end) else .none ;
900+ const len = try expr(gz, scope, .{ .rl = .{ .coerced_ty = .usize_type } }, full.ast.end);
901901 const sentinel = if (full.ast.sentinel != 0) try expr(gz, scope, .{ .rl = .none }, full.ast.sentinel) else .none;
902902 try emitDbgStmt(gz, cursor);
903903 const result = try gz.addPlNode(.slice_length, node, Zir.Inst.SliceLength{
0 commit comments