| ... | @@ -29384,7 +29384,11 @@ fn analyzeSlice( | ... | @@ -29384,7 +29384,11 @@ fn analyzeSlice( |
| 29384 | break :e try sema.analyzeSliceLen(block, src, ptr_or_slice); | 29384 | break :e try sema.analyzeSliceLen(block, src, ptr_or_slice); |
| 29385 | } | 29385 | } |
| 29386 | if (!end_is_len) { | 29386 | if (!end_is_len) { |
| 29387 | break :e try sema.coerce(block, Type.usize, uncasted_end_opt, end_src); | 29387 | if (by_length) { |
| | 29388 | const len = try sema.coerce(block, Type.usize, uncasted_end_opt, end_src); |
| | 29389 | const uncasted_end = try sema.analyzeArithmetic(block, .add, start, len, src, start_src, end_src, false); |
| | 29390 | break :e try sema.coerce(block, Type.usize, uncasted_end, end_src); |
| | 29391 | } else break :e try sema.coerce(block, Type.usize, uncasted_end_opt, end_src); |
| 29388 | } | 29392 | } |
| 29389 | return sema.fail(block, src, "slice of pointer must include end value", .{}); | 29393 | return sema.fail(block, src, "slice of pointer must include end value", .{}); |
| 29390 | }; | 29394 | }; |