diff --git a/src/Sema.zig b/src/Sema.zig index dd5046a83b6e44a31802c6d95c60b8faa87fef0a..68080ee27b14389106a80271f971a7c4195115d7 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -7569,13 +7569,14 @@ fn instantiateGenericCall( { var runtime_i: u32 = 0; for (uncasted_args, 0..) |uncasted_arg, total_i| { + // In the case of a function call generated by the language, the LazySrcLoc + // provided for `call_src` may not point to anything interesting. const arg_src: LazySrcLoc = if (total_i == 0 and bound_arg_src != null) bound_arg_src.? - else - .{ .call_arg = .{ - .call_node_offset = call_src.node_offset.x, - .arg_index = @intCast(total_i), - } }; + else if (call_src == .node_offset) .{ .call_arg = .{ + .call_node_offset = call_src.node_offset.x, + .arg_index = @intCast(total_i), + } } else .unneeded; const comptime_arg = callee.comptime_args.get(ip)[total_i]; if (comptime_arg == .none) {