mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 23:28:48 +00:00
Fix for weird builtin types
This commit is contained in:
@@ -448,11 +448,15 @@ gb_internal void write_canonical_entity_name(TypeWriter *w, Entity *e) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((e->scope->flags & (ScopeFlag_File | ScopeFlag_Pkg)) == 0 ||
|
if (e->scope->flags & (ScopeFlag_Builtin)) {
|
||||||
e->flags & EntityFlag_NotExported) {
|
// ignore
|
||||||
|
} else if ((e->scope->flags & (ScopeFlag_File | ScopeFlag_Pkg)) == 0) {
|
||||||
Scope *s = e->scope;
|
Scope *s = e->scope;
|
||||||
|
|
||||||
while ((s->flags & (ScopeFlag_Proc|ScopeFlag_File)) == 0 && s->decl_info == nullptr) {
|
while ((s->flags & (ScopeFlag_Proc|ScopeFlag_File)) == 0 && s->decl_info == nullptr) {
|
||||||
|
if (s->parent == nullptr) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
s = s->parent;
|
s = s->parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -470,6 +474,8 @@ gb_internal void write_canonical_entity_name(TypeWriter *w, Entity *e) {
|
|||||||
}
|
}
|
||||||
type_writer_appendc(w, gb_bprintf(CANONICAL_NAME_SEPARATOR "[%.*s]" CANONICAL_NAME_SEPARATOR, LIT(file_name)));
|
type_writer_appendc(w, gb_bprintf(CANONICAL_NAME_SEPARATOR "[%.*s]" CANONICAL_NAME_SEPARATOR, LIT(file_name)));
|
||||||
goto write_base_name;
|
goto write_base_name;
|
||||||
|
} else if (s->flags & (ScopeFlag_Builtin)) {
|
||||||
|
goto write_base_name;
|
||||||
}
|
}
|
||||||
gb_printf_err("%s WEIRD ENTITY TYPE %s %u %p\n", token_pos_to_string(e->token.pos), type_to_string(e->type), s->flags, s->decl_info);
|
gb_printf_err("%s WEIRD ENTITY TYPE %s %u %p\n", token_pos_to_string(e->token.pos), type_to_string(e->type), s->flags, s->decl_info);
|
||||||
|
|
||||||
@@ -487,7 +493,7 @@ gb_internal void write_canonical_entity_name(TypeWriter *w, Entity *e) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
print_scope_flags(s);
|
print_scope_flags(s);
|
||||||
GB_PANIC("weird entity");
|
GB_PANIC("weird entity %.*s", LIT(e->token.string));
|
||||||
}
|
}
|
||||||
if (e->pkg != nullptr) {
|
if (e->pkg != nullptr) {
|
||||||
type_writer_append(w, e->pkg->name.text, e->pkg->name.len);
|
type_writer_append(w, e->pkg->name.text, e->pkg->name.len);
|
||||||
|
|||||||
Reference in New Issue
Block a user