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
Report constant dependency cycles during semantic validation #751
bugA problem that causes incorrect behavior or crashes.help wantedThe issue requires extra attention or help from others.needs testingIssues that require additional testing or verification.
A cycle between typed global constants passes semantic checking and only fails during backend emission with an unresolved-cycle E9002. Valid forward references already work and must remain supported.
Tested at 6257ba3eb4b9f1ab6c247a920c6e0c4b5d699331 on Linux amd64 with LLVM 21.1.8 and a compiler built from that checkout. Build it with LLVM_SYS_211_PREFIX=/usr/lib64/llvm21 cargo build --locked --jobs 2.
check exits 0. Both builds fail with E9002: unresolved const cycle or missing symbols after 1 rounds: ["A", "B"]. Replacing B's initializer with 4 makes the forward reference build and run successfully.
Scope
Detect self and mutual constant-dependency cycles in semantic validation and report their declaration/reference locations. This can be implemented independently of arithmetic constant evaluation.
Difficulty: medium.
Completion criteria
Reject self cycles and multi-node cycles, including imported declarations, with source diagnostics.
Keep noncyclic forward references and shared dependencies valid.
Test both human and JSON diagnostics and agreement between check/build.
bugA problem that causes incorrect behavior or crashes.help wantedThe issue requires extra attention or help from others.needs testingIssues that require additional testing or verification.
Activity
Stabilize compiler inputs, target ABIs, and freestanding runtimes (#798)