From 678a7273b7fd9005613974939a6e724f98c2a7fe Mon Sep 17 00:00:00 2001 From: kalsprite Date: Thu, 6 Aug 2026 21:30:23 -0700 Subject: [PATCH] switch assert to 'no file' --- src/docs_writer.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/docs_writer.cpp b/src/docs_writer.cpp index 7a12d0875..67d350f24 100644 --- a/src/docs_writer.cpp +++ b/src/docs_writer.cpp @@ -265,8 +265,12 @@ gb_internal OdinDocPosition odin_doc_token_pos_cast(OdinDocWriter *w, TokenPos c AstFile *file = global_files[pos.file_id]; if (file != nullptr) { OdinDocFileIndex *file_index_found = map_get(&w->file_cache, file); - GB_ASSERT(file_index_found != nullptr); - file_index = *file_index_found; + // NOTE: a documented entity may hold a position in a file belonging to an + // imported package. Such files are only in file_cache when -all-packages is + // used, so fall back to the reserved "no file" index. + if (file_index_found != nullptr) { + file_index = *file_index_found; + } } }