| ... | ... | @@ -6468,22 +6468,6 @@ const CallArgsInfo = union(enum) { |
| 6468 | 6468 | const uncoerced_arg: Air.Inst.Ref = switch (cai) { |
| 6469 | 6469 | inline .resolved, .call_builtin => |resolved| resolved.args[arg_index], |
| 6470 | 6470 | .zir_call => |zir_call| arg_val: { |
| 6471 | | const has_bound_arg = zir_call.bound_arg != .none; |
| 6472 | | if (arg_index == 0 and has_bound_arg) { |
| 6473 | | break :arg_val zir_call.bound_arg; |
| 6474 | | } |
| 6475 | | const real_arg_idx = arg_index - @intFromBool(has_bound_arg); |
| 6476 | | |
| 6477 | | const arg_body = if (real_arg_idx == 0) blk: { |
| 6478 | | const start = zir_call.num_args; |
| 6479 | | const end = @intFromEnum(zir_call.args_body[0]); |
| 6480 | | break :blk zir_call.args_body[start..end]; |
| 6481 | | } else blk: { |
| 6482 | | const start = @intFromEnum(zir_call.args_body[real_arg_idx - 1]); |
| 6483 | | const end = @intFromEnum(zir_call.args_body[real_arg_idx]); |
| 6484 | | break :blk zir_call.args_body[start..end]; |
| 6485 | | }; |
| 6486 | | |
| 6487 | 6471 | // Generate args to comptime params in comptime block |
| 6488 | 6472 | const parent_comptime = block.comptime_reason; |
| 6489 | 6473 | defer block.comptime_reason = parent_comptime; |
| ... | ... | @@ -6505,11 +6489,27 @@ const CallArgsInfo = union(enum) { |
| 6505 | 6489 | }; |
| 6506 | 6490 | } |
| 6507 | 6491 | } |
| 6508 | | // Give the arg its result type |
| 6509 | | const provide_param_ty: Type = maybe_param_ty orelse .generic_poison; |
| 6510 | | sema.inst_map.putAssumeCapacity(zir_call.call_inst, Air.internedToRef(provide_param_ty.toIntern())); |
| 6511 | | // Resolve the arg! |
| 6512 | | const uncoerced_arg = try sema.resolveInlineBody(block, arg_body, zir_call.call_inst); |
| 6492 | |
| 6493 | const has_bound_arg = zir_call.bound_arg != .none; |
| 6494 | const uncoerced_arg = if (arg_index == 0 and has_bound_arg) zir_call.bound_arg else arg: { |
| 6495 | const real_arg_idx = arg_index - @intFromBool(has_bound_arg); |
| 6496 | |
| 6497 | const arg_body = if (real_arg_idx == 0) blk: { |
| 6498 | const start = zir_call.num_args; |
| 6499 | const end = @intFromEnum(zir_call.args_body[0]); |
| 6500 | break :blk zir_call.args_body[start..end]; |
| 6501 | } else blk: { |
| 6502 | const start = @intFromEnum(zir_call.args_body[real_arg_idx - 1]); |
| 6503 | const end = @intFromEnum(zir_call.args_body[real_arg_idx]); |
| 6504 | break :blk zir_call.args_body[start..end]; |
| 6505 | }; |
| 6506 | |
| 6507 | // Give the arg its result type |
| 6508 | const provide_param_ty: Type = maybe_param_ty orelse .generic_poison; |
| 6509 | sema.inst_map.putAssumeCapacity(zir_call.call_inst, Air.internedToRef(provide_param_ty.toIntern())); |
| 6510 | // Resolve the arg! |
| 6511 | break :arg try sema.resolveInlineBody(block, arg_body, zir_call.call_inst); |
| 6512 | }; |
| 6513 | 6513 | |
| 6514 | 6514 | if (block.isComptime() and !try sema.isComptimeKnown(uncoerced_arg)) { |
| 6515 | 6515 | return sema.failWithNeededComptime(block, cai.argSrc(block, arg_index), null); |