diff options
Diffstat (limited to 'src/name_canonicalization.cpp')
| -rw-r--r-- | src/name_canonicalization.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/name_canonicalization.cpp b/src/name_canonicalization.cpp index 5d311068f..a80dc1996 100644 --- a/src/name_canonicalization.cpp +++ b/src/name_canonicalization.cpp @@ -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: |