A class (or record-with-methods) declared in a unit's `implementation`
section is now fully supported: its methods are accepted, its bodies are
type-checked, and its type metadata (typeinfo, vtable, _FieldCleanup) is
emitted on both backends so the unit links and runs.
Three layered problems, fixed together:
1. Semantic ordering + body analysis (uSemantic.AnalyseUnitForExport):
impl-section TYPE decls are registered before LinkClassMethodImpls (so an
impl-section class has its methods in FMethodGroups), and ImplBlock method
bodies are now analysed alongside IntfBlock ones (otherwise field/param
references carried no ResolvedType and codegen aborted).
2. Codegen emission: native EmitUnit and QBE AppendUnit walked only
IntfBlock.TypeDecls. They now emit ImplBlock classes too — method bodies,
class section (typeinfo/vtable/_FieldCleanup) and interface defs — under the
owning unit's mangling prefix. Each backend establishes the emitted unit as
the symbol-table viewing context so the impl-private class resolves during
emission and the reference/definition symbol names agree.
3. Cross-unit leak (the blocker): impl-section symbols were registered in the
shared global scope and leaked into unrelated units via TSymbolTable.Lookup's
flat-table fallback — a class in unit A's implementation section resolved
inside an unrelated unit B that never `uses` A (and self-built the compiler
into a SIGSEGV). Impl-section symbols are now tagged IsImplPrivate and
Lookup suppresses them whenever the viewing unit is not the owner. Interface
symbols and transitive interface-uses visibility are unchanged.
This also closes the corresponding latent leak: an implementation-section
declaration of any unit no longer resolves in units that do not use it.
Tests: cp.test.e2e.sepcompile gains TestNativeImplSectionClass_Compiles,
TestQBEImplSectionClass_Compiles, and TestImplSectionClass_DoesNotLeakCrossUnit.
Rationale recorded in docs/language-rationale.adoc.
All four fixpoints (QBE, native, internal-asm, warm-cache) green; full suite
3859 tests on both the QBE-built and native-built test runner.