mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
Sema: fix type resolution during generic function instantiation
Found when trying to compile the std lib tests for x86_64-macos.
This commit is contained in:
parent
4e002dde69
commit
f3069f51aa
@ -6042,12 +6042,12 @@ fn instantiateGenericCall(
|
||||
.param_comptime, .param_anytype_comptime, .param, .param_anytype => {},
|
||||
else => continue,
|
||||
}
|
||||
const arg_src = call_src; // TODO: better source location
|
||||
const is_runtime = comptime_args[total_i].val.tag() == .generic_poison and
|
||||
comptime_args[total_i].ty.hasRuntimeBits() and
|
||||
!comptime_args[total_i].ty.comptimeOnly();
|
||||
!(try sema.typeRequiresComptime(block, arg_src, comptime_args[total_i].ty));
|
||||
if (is_runtime) {
|
||||
const param_ty = new_fn_info.param_types[runtime_i];
|
||||
const arg_src = call_src; // TODO: better source location
|
||||
const uncasted_arg = uncasted_args[total_i];
|
||||
const casted_arg = try sema.coerce(block, param_ty, uncasted_arg, arg_src);
|
||||
try sema.queueFullTypeResolution(param_ty);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user