feat: specialize compile-time conditionals and type comparisons

This commit is contained in:
2026-10-26 16:14:37 +01:00
parent 4de7c8bfc3
commit 565733666e
6 changed files with 286 additions and 7 deletions
+2 -1
View File
@@ -3422,7 +3422,8 @@ type_syntax proc(kind ast.ExprKind) bool {
@hide:file
type_reference proc(state @State, id ast.NodeId) bool {
if (type_syntax(ast.expr_kind(state.tree, id))) return true
kind :: ast.expr_kind(state.tree, id)
if (type_syntax(kind) or kind == .array_type) return true
binding :: sema.binding(state.resolution, id)
if (binding.kind == .builtin) return true
if (binding.kind != .declaration) return false