fix: track imports used by forced comptime initializers

This commit is contained in:
2026-10-24 02:46:35 +02:00
parent 81531208b2
commit a6e688db71
3 changed files with 36 additions and 1 deletions
+5
View File
@@ -6284,6 +6284,11 @@ build_comptime_expr :: proc(
pkg: ast.Package_Id,
file: ast.File_Id,
) -> hir.Expr_Id {
if expr.left != ast.INVALID_EXPR {
mark_expr_imports_used(checker, expr.left, file)
} else {
mark_block_imports_used(checker, expr.body, file)
}
state := ct_state_make(checker, pkg, file)
defer ct_state_destroy(&state)
value := INVALID_CT_VALUE