You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
with check cannot reliably check arbitrary source files #592
with check should be able to check any .w source file, but checking compiler implementation files directly is not reliable. src/ComptimeEval.w currently fails instead of type-checking cleanly.
Reproduction
From the active repository checkout, which has the local ignored bootstrap seed at src/main:
with check src/ComptimeEval.w
Observed diagnostics include duplicate declarations from the same file:
error: duplicate implementation of trait for type [E1102]
--> src/ComptimeEval.w:88:1
88 | impl Copy for ComptimeControl
error: shadowing is not allowed for 'COMPTIME_RECURSION_LIMIT'
--> src/ComptimeEval.w:67:1
67 | const COMPTIME_RECURSION_LIMIT: i32 = 256
The same duplicate/shadowing block is emitted twice.
From a clean detached worktree at origin/main without ignored local seed/build state:
git worktree add --detach /tmp/with-check-repro origin/main
cd /tmp/with-check-repro
with check src/ComptimeEval.w
Observed earlier failure:
error: import module not found
--> src/ComptimeEval.w:1:1
1 | use ComptimeValue
Expected
with check <path-to-any-.w-file> should resolve sibling/project modules consistently and check the requested file exactly once. Checking src/ComptimeEval.w should not depend on ignored local bootstrap artifacts, and should not load the same declarations twice.
Notes
This surfaced while verifying a compiler/evaluator edit. with check src/main.w succeeds and is currently the practical compiler-entrypoint check, but that is only a workaround. The driver/module resolver should support checking arbitrary files directly.
Mostly fixed in 011ec31 (build + fixpoint + full suite green). Module identity was the raw path string, so different spellings of one file loaded as distinct modules — the checked file itself got re-parsed via its import chain (your duplicate ComptimeControl/COMPTIME_RECURSION_LIMIT block), and ./-prefixed or absolute spellings duplicated much of the import graph (933 errors). Now: a canonical module key (cwd-anchored, dot-collapsed) drives both the resolver's module map and the frontend import-expansion dedup, and the root file is seeded as already-imported.
Verified: with check src/ComptimeEval.w checks clean, as do ./src/... and absolute spellings; imports, mutual imports, and stage1 embed_file all pass.
Remaining (why this stays open): the second repro mode — cd src && with check ComptimeEval.w (and the clean-worktree variant) — still fails import module not found, and instrumentation shows exactly why: the generated modulescompiler.EmbeddedStdlibData / compiler.EmbeddedClangResourceData resolve via the cwd-relative out/gen/<rel> strategy, which misses when cwd isn't the repo root (and doesn't exist at all in a clean worktree until a build generates them). Fixing that needs a decision on project-root anchoring for generated-module resolution (the compiler repo has no with.toml; the resolver's root-walk keys on build.zig/with.toml), plus the clean-worktree bootstrap question this issue already raises. Narrow, well-defined remainder.
Bonus finding recorded in the commit: the frozen seed predates the #629 parser fix and MISCOMPILES the dangling-else-if shape — until the seed is updated, compiler code must avoid it (two normalizers restructured).
Activity
ehartford commentedon Jul 4, 2026
Mostly fixed in 011ec31 (build + fixpoint + full suite green). Module identity was the raw path string, so different spellings of one file loaded as distinct modules — the checked file itself got re-parsed via its import chain (your duplicate ComptimeControl/COMPTIME_RECURSION_LIMIT block), and ./-prefixed or absolute spellings duplicated much of the import graph (933 errors). Now: a canonical module key (cwd-anchored, dot-collapsed) drives both the resolver's module map and the frontend import-expansion dedup, and the root file is seeded as already-imported.
Verified:
with check src/ComptimeEval.wchecks clean, as do./src/...and absolute spellings; imports, mutual imports, and stage1 embed_file all pass.Remaining (why this stays open): the second repro mode —
cd src && with check ComptimeEval.w(and the clean-worktree variant) — still failsimport module not found, and instrumentation shows exactly why: the generated modulescompiler.EmbeddedStdlibData/compiler.EmbeddedClangResourceDataresolve via the cwd-relativeout/gen/<rel>strategy, which misses when cwd isn't the repo root (and doesn't exist at all in a clean worktree until a build generates them). Fixing that needs a decision on project-root anchoring for generated-module resolution (the compiler repo has no with.toml; the resolver's root-walk keys on build.zig/with.toml), plus the clean-worktree bootstrap question this issue already raises. Narrow, well-defined remainder.Bonus finding recorded in the commit: the frozen seed predates the #629 parser fix and MISCOMPILES the dangling-else-if shape — until the seed is updated, compiler code must avoid it (two normalizers restructured).
Windows battery fixes; the root module keeps its spelling (#2788, #809,