aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2022-11-17 23:28:19 +0200
committerVeikka Tuominen <git@vexu.eu>2022-11-20 20:25:12 +0200
commit034507ef7cc492e105ca90c42686aa52bc2097e3 (patch)
treea1d4b2d44b2d5f415d6ce789dcc532ffc2dffc70 /src
parent98b3734b67739ad0e7d53500308495d53250cab0 (diff)
downloadzig-034507ef7cc492e105ca90c42686aa52bc2097e3.tar.gz
zig-034507ef7cc492e105ca90c42686aa52bc2097e3.zip
Module: fix compile error for non-comptime-known global initializer
Diffstat (limited to 'src')
-rw-r--r--src/Module.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Module.zig b/src/Module.zig
index 82dd802f53..d598993c3f 100644
--- a/src/Module.zig
+++ b/src/Module.zig
@@ -4633,7 +4633,7 @@ fn semaDecl(mod: *Module, decl_index: Decl.Index) !bool {
const address_space_src: LazySrcLoc = .{ .node_offset_var_decl_addrspace = 0 };
const ty_src: LazySrcLoc = .{ .node_offset_var_decl_ty = 0 };
const init_src: LazySrcLoc = .{ .node_offset_var_decl_init = 0 };
- const decl_tv = try sema.resolveInstValue(&block_scope, init_src, result_ref, undefined);
+ const decl_tv = try sema.resolveInstValue(&block_scope, init_src, result_ref, "global variable initializer must be comptime-known");
// Note this resolves the type of the Decl, not the value; if this Decl
// is a struct, for example, this resolves `type` (which needs no resolution),