diff --git a/stage0/sema.c b/stage0/sema.c index a100dd1881..1e3ac7ecc5 100644 --- a/stage0/sema.c +++ b/stage0/sema.c @@ -11559,8 +11559,10 @@ static bool analyzeBodyInner( resolved = s_file_root_type[fid]; // Create ptr_nav for the import nav, // matching Zig's analyzeNavRefInner. - if (s_in_main_analysis - && sema->file_idx != UINT32_MAX) { + // Created during both preamble and main analysis + // (the Zig compiler creates these whenever imports + // are accessed in comptime context). + if (sema->file_idx != UINT32_MAX) { uint32_t nav_idx2 = findNavInNamespace( s_file_namespace[sema->file_idx], decl_name); if (nav_idx2 != UINT32_MAX) {