aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2025-11-05 10:06:40 +0000
committergingerBill <gingerBill@users.noreply.github.com>2025-11-05 10:06:40 +0000
commitea5db0e04864f7e453a5b5faa305df22543c4b75 (patch)
tree52cc54b94afa169ae903dd3aacc338c67ebc846c /src
parent50350d2364f3719b956a23402e35718ff257296e (diff)
Fix type name name canonicalization within an anonymously nested procedure in a struct.
Diffstat (limited to 'src')
-rw-r--r--src/name_canonicalization.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/name_canonicalization.cpp b/src/name_canonicalization.cpp
index c2acf83f5..87d7a8522 100644
--- a/src/name_canonicalization.cpp
+++ b/src/name_canonicalization.cpp
@@ -527,6 +527,11 @@ gb_internal void write_canonical_entity_name(TypeWriter *w, Entity *e) {
} else if (s->flags & (ScopeFlag_Builtin)) {
goto write_base_name;
}
+
+ if (e->kind == Entity_TypeName) {
+ 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);
auto const print_scope_flags = [](Scope *s) {
@@ -543,7 +548,7 @@ gb_internal void write_canonical_entity_name(TypeWriter *w, Entity *e) {
};
print_scope_flags(s);
- GB_PANIC("weird entity %.*s", LIT(e->token.string));
+ GB_PANIC("weird entity %.*s (%.*s)", LIT(e->token.string), LIT(entity_strings[e->kind]));
}
if (e->pkg != nullptr) {
type_writer_append(w, e->pkg->name.text, e->pkg->name.len);