Sema: fix spurious type has no namespace error

Closes #19232
This commit is contained in:
Veikka Tuominen
2024-03-17 13:23:54 +02:00
parent f983adfc10
commit fec4b7ef5c
4 changed files with 153 additions and 142 deletions

View File

@@ -2852,7 +2852,7 @@ pub const Object = struct {
const stack_trace_str = try mod.intern_pool.getOrPutString(mod.gpa, "StackTrace");
// buffer is only used for int_type, `builtin` is a struct.
const builtin_ty = mod.declPtr(builtin_decl).val.toType();
const builtin_namespace = builtin_ty.getNamespace(mod).?;
const builtin_namespace = mod.namespacePtrUnwrap(builtin_ty.getNamespaceIndex(mod)).?;
const stack_trace_decl_index = builtin_namespace.decls.getKeyAdapted(stack_trace_str, Module.DeclAdapter{ .zcu = mod }).?;
const stack_trace_decl = mod.declPtr(stack_trace_decl_index);