cleanup: drop resolved-issue citations from src comments
Sweep all src/**.zig comments that cite resolved issues (issue NNNN / fix-NNNN / KB-N): the invariant or mechanism each comment states is kept; the historical citation is dropped, per the no-conclusion-comments rule. Pure-history parentheticals are removed outright. References to the 16 still-open issues (0030, 0041-0056) are untouched, as are test NAMES carrying regression provenance (matching the sanctioned "Regression (issue NNNN)" example-header convention). Also removes the issues/0019-import-non-transitive-c-scope/ fixture dir — the issue is superseded and its behavior is covered by examples/0706-modules-import-non-transitive.sx (the .md writeup stays). issues/0030's repro .sx stays: that issue is an open feature request. Gate: zig build OK; zig build test 426/426; run_examples 541/0; zero expected/ snapshot churn.
This commit is contained in:
@@ -146,7 +146,7 @@ pub fn isFloatConstType(ty: TypeId) bool {
|
||||
/// division apart from an integer one even when both operands fold to integers
|
||||
/// (`K / 3`, `ME / 3`). `frame` cycle-guards a const whose value references
|
||||
/// another const; a name already on the chain has no compile-time value → not
|
||||
/// float-valued (issue 0095 / F0.11-6).
|
||||
/// float-valued.
|
||||
fn moduleConstFloatValuedFramed(consts: *const std.StringHashMap(ModuleConstInfo), table: *const types.TypeTable, name: []const u8, parent: ?*const ModuleConstFrame) bool {
|
||||
if (moduleConstFrameContains(parent, name)) return false;
|
||||
const ci = consts.get(name) orelse return false;
|
||||
@@ -160,7 +160,7 @@ fn moduleConstFloatValuedFramed(consts: *const std.StringHashMap(ModuleConstInfo
|
||||
/// int via `floatToIntExact`). `moduleConstIntFramed` consults this so a count
|
||||
/// is gated on `ModuleConstInfo.ty`, not just the shape of the initializer node:
|
||||
/// a `string`/`bool`/pointer/struct-typed const can never be folded into a count
|
||||
/// off an integer-looking initializer (issue 0088 — the second symptom, where
|
||||
/// off an integer-looking initializer (the second symptom, where
|
||||
/// `N : string : 4` folded `[N]s64` to 4 by reading the `int_literal` node and
|
||||
/// ignoring the `string` annotation).
|
||||
pub fn isCountableConstType(table: *const types.TypeTable, ty: TypeId) bool {
|
||||
@@ -187,7 +187,7 @@ fn moduleConstIntFramed(consts: *const std.StringHashMap(ModuleConstInfo), table
|
||||
/// registration-time path (`type_bridge.StatelessInner`). They must agree on
|
||||
/// which named consts a `[N]T` dimension resolves to; if they diverge, an array
|
||||
/// laid out via a type alias (`Arr :: [N]T`, stateless) gets a different length
|
||||
/// than the direct form (`a : [N]T`, stateful) — the issue-0083 miscompile.
|
||||
/// than the direct form (`a : [N]T`, stateful) — that miscompile class.
|
||||
/// Every const's RHS is folded through the shared `evalConstIntExpr`, so an
|
||||
/// untyped (`N :: 16`) / typed (`N : s64 : 16`) literal, an integral float
|
||||
/// (`N : f64 : 4.0` → 4, via `floatToIntExact`; `4.5` → null), AND an expression
|
||||
@@ -225,7 +225,7 @@ pub fn moduleConstFloat(consts: *const std.StringHashMap(ModuleConstInfo), table
|
||||
/// (`ME :: 4.0 + 1.0`, whose placeholder type is `s64`), and a non-integral float
|
||||
/// const (`F : f64 : 2.5`). SINGLE source for the stateful (`Lowering`) and
|
||||
/// stateless (`type_bridge`) division-arm float checks, so they agree on which
|
||||
/// const-leaf divisions are float (issue 0095 / F0.11-6).
|
||||
/// const-leaf divisions are float.
|
||||
pub fn moduleConstIsFloatTyped(consts: *const std.StringHashMap(ModuleConstInfo), table: *const types.TypeTable, name: []const u8) bool {
|
||||
return moduleConstFloatValuedFramed(consts, table, name, null);
|
||||
}
|
||||
@@ -235,8 +235,8 @@ pub fn moduleConstIsFloatTyped(consts: *const std.StringHashMap(ModuleConstInfo)
|
||||
/// numeric-limit (`f64.max`), or arithmetic over any of those. THE predicate the
|
||||
/// int folder's division arm consults: `/` with a float operand is FLOAT division
|
||||
/// (`5.0 / 2.0` = 2.5), and folding it with integer truncating division would
|
||||
/// silently accept a non-integral float at a count / typed binding (issue 0095 /
|
||||
/// F0.11-6). `+ - *` agree between int and float arithmetic for the integral
|
||||
/// silently accept a non-integral float at a count / typed binding.
|
||||
/// `+ - *` agree between int and float arithmetic for the integral
|
||||
/// operands the int folder ever sees (a non-integral operand folds to null first),
|
||||
/// so ONLY `/` needs this guard. A leaf name resolves through `ctx.nameIsFloatTyped`
|
||||
/// — the same ctx that supplies `lookupDimName`/`lookupFloatName` — so an INTEGRAL
|
||||
@@ -257,8 +257,7 @@ pub fn isFloatValuedExpr(node: *const Node, ctx: anytype) bool {
|
||||
.field_access => |fa| blk: {
|
||||
// A backtick RAW receiver (`` `f64.epsilon ``) is an ordinary field
|
||||
// READ on a value whose spelling shadows a builtin type, NOT the
|
||||
// numeric-limit accessor — so it is not a float leaf (issues 0092 /
|
||||
// 0093). Only a BARE type receiver folds to a float limit.
|
||||
// numeric-limit accessor — so it is not a float leaf. Only a BARE type receiver folds to a float limit.
|
||||
const obj_name: ?[]const u8 = switch (fa.object.data) {
|
||||
.identifier => |id| if (id.is_raw) null else id.name,
|
||||
.type_expr => |te| if (te.is_raw) null else te.name,
|
||||
@@ -279,7 +278,7 @@ pub fn isFloatValuedExpr(node: *const Node, ctx: anytype) bool {
|
||||
/// integer-expression folder for the compiler — array dimensions (`[N]T`,
|
||||
/// `[M + 1]T`), Vector lane counts (`Vector(N, f32)`), generic value-param
|
||||
/// args (`Vec(N, f32)`), and `inline for 0..M` bounds all route here so they
|
||||
/// cannot disagree on what a given expression evaluates to (the issue-0083
|
||||
/// cannot disagree on what a given expression evaluates to (the
|
||||
/// two-resolver class of bug). Folds integer `+ - * / %` and unary negate over
|
||||
/// int literals, integral float literals (`[4.0]T` → 4, via `floatToIntExact`),
|
||||
/// and named module / comptime consts — recursively, so nested and parenthesised
|
||||
@@ -290,7 +289,7 @@ pub fn isFloatValuedExpr(node: *const Node, ctx: anytype) bool {
|
||||
/// lhs/rhs is float-valued (`5.0 / 2.0`, `K / 3` with `K : f64 : 4.0`) is FLOAT
|
||||
/// division, NOT integer truncation, so this folder refuses it (`isFloatValuedExpr`)
|
||||
/// and lets `evalConstFloatExpr` + the unified narrowing rule see the true value
|
||||
/// (issue 0095 / F0.11-6). `+ - *` need no such guard — they agree between int and
|
||||
///. `+ - *` need no such guard — they agree between int and
|
||||
/// float arithmetic for the integral operands this folder ever sees.
|
||||
///
|
||||
/// Leaves resolve through the ctx, so each call site shares the SAME folding
|
||||
@@ -319,7 +318,7 @@ pub fn evalConstIntExpr(node: *const Node, ctx: anytype) ?i64 {
|
||||
// ordinary field READ on a value whose spelling shadows a builtin
|
||||
// type name, NOT a numeric-limit / pack-arity accessor — so it is
|
||||
// never a compile-time leaf here; its field is a runtime value
|
||||
// (issues 0092/0093, F0.11-7). Only a BARE type/name receiver folds a
|
||||
//. Only a BARE type/name receiver folds a
|
||||
// `<pack>.len` / `<IntType>.min`/`.max`. Mirrors the same `is_raw`
|
||||
// guard `isFloatValuedExpr` already applies, so the const cluster
|
||||
// (this folder, `evalConstFloatExpr`, `isFloatValuedExpr`) agrees.
|
||||
@@ -360,7 +359,7 @@ pub fn evalConstIntExpr(node: *const Node, ctx: anytype) ?i64 {
|
||||
// truncating division — refuse to fold it here so the value
|
||||
// surfaces through `evalConstFloatExpr` + the unified float→int
|
||||
// rule (integral folds, non-integral errors) instead of silently
|
||||
// truncating to an integer (issue 0095 / F0.11-6). A genuine
|
||||
// truncating to an integer. A genuine
|
||||
// integer `/` (both operands integer-valued) still truncates.
|
||||
.div => if (isFloatValuedExpr(b.lhs, ctx) or isFloatValuedExpr(b.rhs, ctx))
|
||||
null
|
||||
@@ -425,7 +424,7 @@ pub fn evalConstFloatExpr(node: *const Node, ctx: anytype) ?f64 {
|
||||
// A backtick RAW receiver (`` `f64.epsilon ``) is an ordinary field
|
||||
// READ on a value that shadows a builtin float type name, NOT the
|
||||
// numeric-limit accessor — its field is a runtime value, never a
|
||||
// compile-time leaf (issues 0092/0093, F0.11-7). Mirrors the `is_raw`
|
||||
// compile-time leaf. Mirrors the `is_raw`
|
||||
// guard `isFloatValuedExpr` already applies; only a BARE type receiver
|
||||
// folds a float limit.
|
||||
const obj_name: ?[]const u8 = switch (fa.object.data) {
|
||||
@@ -465,10 +464,10 @@ pub fn evalConstFloatExpr(node: *const Node, ctx: anytype) ?f64 {
|
||||
}
|
||||
|
||||
/// The outcome of folding a compile-time COUNT expression to an `i64` under the
|
||||
/// unified float→int narrowing rule (F0.11 / issue 0095). THE single int-or-
|
||||
/// unified float→int narrowing rule. THE single int-or-
|
||||
/// integral-float count fold: `foldDimU32` (array dim / Vector lane / u32 value-
|
||||
/// param) and the non-`u32` value-param gate both route through `foldCountI64`,
|
||||
/// so no count site can disagree on which floats fold (the issue-0083 unify-or-
|
||||
/// so no count site can disagree on which floats fold (the unify-or-
|
||||
/// diverge rule extended to floats).
|
||||
pub const CountFold = union(enum) {
|
||||
/// An integer expression, or an INTEGRAL compile-time float (`[F + 1.5]` → 4).
|
||||
@@ -500,7 +499,7 @@ pub fn foldCountI64(node: *const Node, ctx: anytype) CountFold {
|
||||
/// SINGLE place a folded integer becomes a `u32`, so the i64→u32 narrowing is
|
||||
/// range-checked exactly once and no call site does a bare `@intCast` that could
|
||||
/// panic the compiler on a valid-but-oversized fold (a literal `5_000_000_000`
|
||||
/// is a valid `i64` yet `> maxInt(u32)` — issue 0087). Each call site maps a
|
||||
/// is a valid `i64` yet `> maxInt(u32)`). Each call site maps a
|
||||
/// non-`.ok` variant onto its own clean diagnostic + `.unresolved` / abort.
|
||||
pub const DimU32 = union(enum) {
|
||||
/// Folded to a `u32` in `[min, maxInt(u32)]`.
|
||||
@@ -520,7 +519,7 @@ pub const DimU32 = union(enum) {
|
||||
/// integral-float fold), then range-check against `[min, maxInt(u32)]`. THE single
|
||||
/// fold-to-u32 for every array dimension, Vector lane, and value-param count —
|
||||
/// routing all of them here guarantees the narrowing is checked once and can never
|
||||
/// abort the compiler (issue 0087). The fold itself stays in `i64`; only this one
|
||||
/// abort the compiler. The fold itself stays in `i64`; only this one
|
||||
/// conversion is the `u32` gate.
|
||||
pub fn foldDimU32(node: *const Node, ctx: anytype, min: u32) DimU32 {
|
||||
const v = switch (foldCountI64(node, ctx)) {
|
||||
@@ -539,7 +538,7 @@ pub fn foldDimU32(node: *const Node, ctx: anytype, min: u32) DimU32 {
|
||||
/// `type_bridge.foldArrayDim`) — emit through here, so an oversized / negative /
|
||||
/// non-const dimension reports the SAME message regardless of whether it was
|
||||
/// written directly (`a : [N]T`) or via a type alias (`Arr :: [N]T`). Folding
|
||||
/// the wording into one place is the diagnostic-accuracy half of the issue-0083
|
||||
/// the wording into one place is the diagnostic-accuracy half of the
|
||||
/// unify-or-diverge story: `foldDimU32` is the single fold, this is the single
|
||||
/// message map. Only call with a non-`.ok` result (the `.ok` arm is a no-op).
|
||||
pub fn reportDimError(diag: *errors.DiagnosticList, span: ?ast.Span, result: DimU32) void {
|
||||
@@ -593,8 +592,8 @@ pub const GlobalInfo = struct { id: inst.GlobalId, ty: TypeId };
|
||||
/// read-only views and are never freed here.
|
||||
///
|
||||
/// Every owned map allocates through the compilation allocator passed to
|
||||
/// `init` (arena-backed in both the driver and the tests — KB-9 removed the
|
||||
/// old `page_allocator` field defaults). Written only by the
|
||||
/// `init` (arena-backed in both the driver and the tests;
|
||||
/// no `page_allocator` field defaults). Written only by the
|
||||
/// declaration scan / registration code in `Lowering`; read everywhere else.
|
||||
pub const ProgramIndex = struct {
|
||||
/// The lowering/compilation allocator (`module.alloc`), retained so the
|
||||
@@ -612,7 +611,7 @@ pub const ProgramIndex = struct {
|
||||
import_graph: ?*std.StringHashMap(std.StringHashMap(void)) = null,
|
||||
/// Module path → set of directly FLAT-imported paths — the subset of
|
||||
/// `import_graph` edges from a bare `#import` (never a namespaced
|
||||
/// `ns :: #import`). fix-0102c's bare-name disambiguation walks this to
|
||||
/// `ns :: #import`). The bare-name disambiguation walks this to
|
||||
/// decide which same-name authors a flat importer can reach. Borrowed view.
|
||||
flat_import_graph: ?*std.StringHashMap(std.StringHashMap(void)) = null,
|
||||
/// Per-module scalar raw-decl index (`path → name → RawDeclRef`), built by
|
||||
@@ -636,7 +635,7 @@ pub const ProgramIndex = struct {
|
||||
/// null-FuncId `lowerFunction` path with no `Function.source_file` to
|
||||
/// restore. This carries the alias's OWN module source so its body lowers
|
||||
/// in the right visibility context — its intra-module / own-import callees
|
||||
/// resolve (issue 0100 F1). Keyed/allocated with the lowering allocator.
|
||||
/// resolve. Keyed/allocated with the lowering allocator.
|
||||
qualified_fn_source: std.StringHashMap([]const u8),
|
||||
/// sx alias → ForeignClassDecl (jni_class / objc_class / swift_class / ... — registered in scan pass).
|
||||
foreign_class_map: std.StringHashMap(*const ast.ForeignClassDecl),
|
||||
|
||||
Reference in New Issue
Block a user