blaise/compiler
Andrew Haines 6bc8aff47d feat(semantic): cross-unit const shadowing with last-in-uses wins
When two used units export a constant of the same name, the importer
silently kept whichever was registered first and destroyed the other,
so the later unit in the `uses` clause could never shadow the earlier
one. Pascal's rule is last-in-uses wins.

Add TScope.ExtractLocal / TSymbolTable.ExtractLocal, which detach a
symbol from a scope without freeing it (the owning list keeps the
object alive for any per-unit cache that still references it). On a
cross-unit const collision, both the source-analysis path
(AnalyseConstDecls) and the prebuilt-import path (RegisterConsts) now
extract the prior unit's const and install the later unit's as the
flat-scope winner, instead of dropping the newcomer. Same-block and
unit-name-marker duplicates remain hard errors.

Adds a two-written-units e2e helper (CompileAndRunWithUnits) and
regression tests asserting the `uses` order decides the winner.
2026-06-30 19:15:13 +01:00
..
src feat(semantic): cross-unit const shadowing with last-in-uses wins 2026-06-30 19:15:13 +01:00
project.xml refactor(rtl): relocate RTL units into the compiler tree (dotted-flat names) 2026-06-25 16:05:44 +01:00