| ... | ... | @@ -3929,11 +3929,15 @@ fn zirForLen(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air. |
| 3929 | 3929 | .Int, .ComptimeInt => true, |
| 3930 | 3930 | else => false, |
| 3931 | 3931 | }; |
| 3932 | const arg_src: LazySrcLoc = .{ .for_input = .{ |
| 3933 | .for_node_offset = inst_data.src_node, |
| 3934 | .input_index = i, |
| 3935 | } }; |
| 3932 | 3936 | const arg_len = if (is_int) object else l: { |
| 3933 | | try checkIndexable(sema, block, src, object_ty); |
| 3937 | try checkIndexable(sema, block, arg_src, object_ty); |
| 3934 | 3938 | if (!object_ty.indexableHasLen()) continue; |
| 3935 | 3939 | |
| 3936 | | break :l try sema.fieldVal(block, src, object, "len", src); |
| 3940 | break :l try sema.fieldVal(block, arg_src, object, "len", arg_src); |
| 3937 | 3941 | }; |
| 3938 | 3942 | if (len == .none) { |
| 3939 | 3943 | len = arg_len; |
| ... | ... | @@ -3949,14 +3953,10 @@ fn zirForLen(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air. |
| 3949 | 3953 | .for_node_offset = inst_data.src_node, |
| 3950 | 3954 | .input_index = len_idx, |
| 3951 | 3955 | } }; |
| 3952 | | const b_src: LazySrcLoc = .{ .for_input = .{ |
| 3953 | | .for_node_offset = inst_data.src_node, |
| 3954 | | .input_index = i, |
| 3955 | | } }; |
| 3956 | 3956 | try sema.errNote(block, a_src, msg, "length {} here", .{ |
| 3957 | 3957 | v.fmtValue(Type.usize, sema.mod), |
| 3958 | 3958 | }); |
| 3959 | | try sema.errNote(block, b_src, msg, "length {} here", .{ |
| 3959 | try sema.errNote(block, arg_src, msg, "length {} here", .{ |
| 3960 | 3960 | arg_val.fmtValue(Type.usize, sema.mod), |
| 3961 | 3961 | }); |
| 3962 | 3962 | break :msg msg; |