mirror of
https://github.com/odin-lang/Odin.git
synced 2026-06-08 19:44:20 +00:00
Fix name canonicalization for doc writer
This commit is contained in:
@@ -520,6 +520,8 @@ write_base_name:
|
||||
return;
|
||||
}
|
||||
|
||||
gb_internal bool is_in_doc_writer(void);
|
||||
|
||||
// NOTE(bill): This exists so that we deterministically hash a type by serializing it to a canonical string
|
||||
gb_internal void write_type_to_canonical_string(TypeWriter *w, Type *type) {
|
||||
if (type == nullptr) {
|
||||
@@ -719,7 +721,13 @@ gb_internal void write_type_to_canonical_string(TypeWriter *w, Type *type) {
|
||||
return;
|
||||
|
||||
case Type_Generic:
|
||||
GB_PANIC("Type_Generic should never be hit");
|
||||
if (is_in_doc_writer()) {
|
||||
type_writer_appendc(w, "$");
|
||||
type_writer_append(w, type->Generic.name.text, type->Generic.name.len);
|
||||
type_writer_append_fmt(w, "%lld", cast(long long)type->Generic.id);
|
||||
} else {
|
||||
GB_PANIC("Type_Generic should never be hit");
|
||||
}
|
||||
return;
|
||||
|
||||
case Type_Named:
|
||||
|
||||
Reference in New Issue
Block a user