Skip to content

Commit f3069f5

Browse files
committed
Sema: fix type resolution during generic function instantiation
Found when trying to compile the std lib tests for x86_64-macos.
1 parent 4e002dd commit f3069f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Sema.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6042,12 +6042,12 @@ fn instantiateGenericCall(
60426042
.param_comptime, .param_anytype_comptime, .param, .param_anytype => {},
60436043
else => continue,
60446044
}
6045+
const arg_src = call_src; // TODO: better source location
60456046
const is_runtime = comptime_args[total_i].val.tag() == .generic_poison and
60466047
comptime_args[total_i].ty.hasRuntimeBits() and
6047-
!comptime_args[total_i].ty.comptimeOnly();
6048+
!(try sema.typeRequiresComptime(block, arg_src, comptime_args[total_i].ty));
60486049
if (is_runtime) {
60496050
const param_ty = new_fn_info.param_types[runtime_i];
6050-
const arg_src = call_src; // TODO: better source location
60516051
const uncasted_arg = uncasted_args[total_i];
60526052
const casted_arg = try sema.coerce(block, param_ty, uncasted_arg, arg_src);
60536053
try sema.queueFullTypeResolution(param_ty);

0 commit comments

Comments
 (0)