don't crash when can't evaluate comptime expression with inferred type

Closes #15911.
This commit is contained in:
yujiri8 authored and GitHub committed 2023-05-31 11:15:52 +00:00
1 parent 32e719e070
commit cd1417dbdf
3 files changed
+24 -3

No files matched your search

+4
View File
@@ -6021,6 +6021,10 @@ pub fn errNoteNonLazy(
comptime format: []const u8,
args: anytype,
) error{OutOfMemory}!void {
if (src_loc.lazy == .unneeded) {
assert(parent.src_loc.lazy == .unneeded);
return;
}
const msg = try std.fmt.allocPrint(mod.gpa, format, args);
errdefer mod.gpa.free(msg);