docs(ir): mark sema/types as editor-only, not compiler truth (A1.2)
Architecture phase A1.2 — documentation/comment only, no behavior change. Resolve the ambiguity over which type model compiler decisions trust: - src/sema.zig: file-level module doc stating it is the editor symbol/type index for the language server (navigation/completion), NOT a compiler semantic pass. Its Type values are editor metadata; the compiler uses the canonical TypeId/TypeTable model in src/ir/. sx requires no as-you-type type checking -- authoritative diagnostics are produced on save by the canonical pipeline. Added notes on SemaResult, Analyzer, resolveTypeNode, inferExprType. No public API renamed (would churn LSP call sites). - src/types.zig: note that Type is editor metadata only, not compiler truth; do not expand for new compiler semantics (A8 deletes/reduces it). - src/ir/types.zig: fix stale TypeTable.aliases comment -- it borrows Lowering.program_index.type_alias_map (post-A1.1b). Deleting the LSP's parallel sema diagnostic stream is A8.1, not this step. Gate green: zig build, zig build test, bash tests/run_examples.sh (350 passed).
This commit is contained in:
@@ -2,6 +2,12 @@ const std = @import("std");
|
||||
const ast = @import("ast.zig");
|
||||
const Node = ast.Node;
|
||||
|
||||
/// Editor metadata type model, used only by `src/sema.zig` (the language-server
|
||||
/// symbol/type index) for navigation, completion, and hover. NOT the compiler's
|
||||
/// source of truth: lowering, codegen, and layout use the canonical
|
||||
/// `TypeId` / `TypeTable` model in `src/ir/types.zig`. Do not expand this to
|
||||
/// carry new compiler semantics; the architecture endpoint (phase A8) is to
|
||||
/// delete it or reduce it to display-only data derived from `TypeId`.
|
||||
pub const Type = union(enum) {
|
||||
// Variable-width integers (1–64 bits)
|
||||
signed: u8,
|
||||
|
||||
Reference in New Issue
Block a user