ReviewOS

home-lang/home

fix(ts): merge nested ambient class namespace static members exactly

#938
Closed glennmichael123 opened this 8 days ago ·
8 days ago

Home cannot yet merge a class and same-named namespace in separate declare-module fragments into one exact constructor/static surface. The declaration graph refuses to publish a partial merged class, but the consumer then misses an expected diagnostic. Repro: first.d.ts declares module pkg with namespace Nested and class Box; second.d.ts augments namespace Nested.Box with const extra: 2; main.ts assigns Nested.Box.extra to a variable of literal type 1. TypeScript 5.9.3 reports one TS2322 at main.ts:3:7; Home reports zero diagnostics. Both were rerun under the 3840 MB guard on 2026-10-22. Required implementation: combine the class constructor, instance, and static schema with namespace augmentation value members across fragments, preserving source ownership and exact member annotations. Admit only after the full value and type surface is proven; add same-file and cross-file differential tests. No degraded any or partial route. Related: #844, #66.

8 days ago

The prerequisite nested ambient class route is now on origin/main as 51bf5e5c4. It preserves class instance, constructor, and own static annotations across merged namespace fragments, but deliberately does not admit a partial class-plus-namespace route. Reverified after that commit: TypeScript 5.9.3 emits one TS2322 for wrong literal type of Nested.Box.extra; Home emits zero diagnostics. This issue remains open for the exact augmentation merge and differential acceptance tests.

8 days ago

Progress pushed directly to origin/main as c5385107b. Nested ambient class and same-named namespace now combine constructor, instance, own statics, augmented const/function, deeper namespace values, and nested types. Same-file, split-file, and reverse owner order pass; class static/member collisions follow source order. Program 366/366, checker 4679/4679, CLI 89/89 under the 3840 MB guard. Home CLI matches TypeScript 5.9.3 exactly on the seven-error full-declaration fixture in both owner orders and the require-alias fixture. Unsupported getter schemas still withhold incomplete routes. Keep this issue OPEN: without skipLibCheck, a colliding class static and namespace const should emit two TS2451 declaration diagnostics; Home currently emits only the matching consumer TS2322. Duplicate function overloads and other augmentation forms are not claimed verified.

8 days ago

Pushed df37c2e (https://github.com/home-lang/home/commit/df37c2e1c) directly to origin/main as glennmichael123, three files, no coauthors. A bound-HIR Program pass now reports colliding nested ambient class statics and namespace values at both declarations. The streaming CLI emits the late cross-file diagnostics too. TypeScript 5.9.3 and Home match codes, messages, and positions for cross-file const (two TS2451), same-file const (two TS2300), cross-file method/function and property/var (two TS2300), non-exported namespace const (two TS2451), and overloaded static methods (three TS2300). skipLibCheck suppresses declaration errors; the consumer TS2322 remains. Guarded Program 368/368 and CLI 89/89 pass. Keep open for broader augmentation forms not yet differentially verified; #844 and #66 remain open. Pinned Bun WebKit is absent, so no native Bun corpus parity claim.

8 days ago

Getter-only augmentation slice landed directly on origin/main as b5c9236c3, authored and committed by glennmichael123 with no coauthors (five changed files).

Baseline: TypeScript 5.9.3 reported three TS2322 and two TS2540 errors for a split ambient class/namespace with typed instance and static getters; Home reported zero. The new Program regression failed before the fix at expected 5, found 0. Home now transfers getter-only accessors as typed readonly instance/static properties, preserving the constructor and namespace-added const. The test covers same-file, split-file, reversed owner order, normal compilation and streaming. The existing no-partial-route test now uses a still-unsupported setter-only accessor instead of treating a supported getter as unsupported.

Final verification under the 3840 MB guard, one heavy process at a time: Program 379/379, CLI 89/89, compiler entrypoint 62/62. Checker and driver gates were cached-green. The unchanged logical five-error fixture now matches TypeScript 5.9.3 exactly in Home CLI for codes, messages and locations. Targeted Pickier, Zig formatting and staged diff checks pass. Pinned Bun WebKit is absent here, so native Bun parity is not claimed.

Keep #938 open: setter-only and paired accessors have distinct read/write semantics not represented by the current single-type member schema; those shapes remain withheld rather than publishing a partial merged route. Other augmentation forms still need differential review. Parent #844 and overall #66 remain open.

8 days ago

Pushed 26ab8e71f directly to main as glennmichael123 (no coauthors). This completes another exact ambient class/namespace merge slice: generic Box<t> can now be referenced by a factory signature in the same file, a second declaration file, or reverse file-add order. The source-owned schema resolves the class by exact ambient module + parent namespace path; the declaration graph still rejects partial routes. A negative case proves a generic Box in a different module cannot satisfy the reference and reports TS2709, matching TypeScript 5.9.3. TypeScript 5.9.3 also reports the same two TS2322 consumer diagnostics in the positive split-file fixture. Verification: Program 381/381, checker 4679/4679, driver 222/222, CLI 89/89, entrypoint 62/62; all builds serial under the 3840 MB guard. Zig fmt and diff checks pass. Repo-wide Pickier remains red on unrelated existing files (1615 errors, 730 warnings across 83210 scanned files), so no lint-pass claim. Keep #938 open: setter-backed accessor and remaining augmentation forms still need separate parity proof. Related #66.

8 days ago

Paired-accessor progress is pushed directly to origin/main in two coherent three-file commits, both authored/committed by glennmichael123 <gtorregosa@gmail.com> with no coauthors:

  • af059e9e9 adds distinct source-owned write types and relocates them through reachable cross-pool type transfer (with a selected-graph regression).
  • de0b9bd4e pairs annotated getters/setters in class instance/static schemas and uses the setter parameter type for writes while preserving the getter read type.

The Program regression covers a merged nested ambient class/namespace in one file, two files, and reverse file-add order; static and instance accessors both retain wider setter inputs and narrower getter reads. A second regression covers a generic setter-only type parameter and two same-named classes in different ambient modules using explicitly typed instances. TypeScript 5.9.3 and Home agree on diagnostic codes and source offsets for the tested cases. Under the 3,840 MB guard, one heavy process at a time: Program 383/383, checker 4680/4680, driver 222/222, CLI 89/89, compiler entrypoint 62/62; Zig format and diff checks pass. This tranche does not claim the complete augmentation surface or native Bun parity; the pinned Bun WebKit remains absent locally.

Keep #938 OPEN. Setter-only accessors are still withheld from the exact merged route, and the distinct explicit generic new Nested.Box<T>() instantiation discrepancy is tracked in #941. Other augmentation forms still need differential proof. Related #66.

8 days ago

Follow-up from closed #941: 13cb2aa and dade2cf now keep paired generic accessor read/write types intact through merged nested ambient class construction and setter writes. Pinned TypeScript 5.9.3 control and Home agree on the four TS2322 diagnostics in the two-module fixture. Program and CLI-adapter tests each cover split, reverse-add-order, and same-file declarations; guarded Program 383/383, checker 4681/4681, and tsc_main 63/63. Keeping #938 open for its broader augmentation/remaining setter-only forms rather than equating this focused constructor/accessor result with every merged surface.

8 days ago

Setter-only ambient accessor slice is now on origin/main as 26f7265b6, a three-file conventional commit authored/committed by glennmichael123 without coauthors. Source-owned class schemas now publish annotated setter-only instance and static members with the setter input type as both read and write type; paired getter/setter handling keeps its distinct read/write types. Unannotated or duplicate ambiguous setters still withhold the route rather than publishing a partial merge. Differential TypeScript 5.9.3 fixture reports four TS2322 for wrong-type reads and writes of generic setter-only instance/static members in split, reverse-add-order, and same-file merged class/namespace declarations; Home matches. A compatible write followed by a narrowed read also remains valid. Guarded tests (one heavy process at a time, 3840 MB): Program 384/384; driver 222/222; ts_cli 89/89; tsc_main 64/64; d_hm 34/34. Zig formatting and staged diff checks passed. Keep #938 OPEN for remaining augmentation shapes and broader parity proof. Pinned Bun WebKit is absent locally, so no Bun-native corpus claim. Related #66.

8 days ago

Pushed e2124deff directly to origin/main as glennmichael123 (five changed files, conventional commit, no coauthors). Merged ambient derived classes now inherit the base constructor declaration and exact generic heritage arguments through the source-owned schema. Multi-level inheritance, overload signatures, default type parameters, and explicit constructor overrides are covered. The checker now reports TS2345 when exactly one visible constructor overload matches the argument count and TS2554 when none matches the aggregate range, rather than a blanket TS2769. TypeScript 5.9.3 and rebuilt Home CLI match codes, messages, and locations on the original three-error merged fixture and the five-error constructor-chain fixture. Final serial 3840 MB guarded gates: checker 4682/4682, Program 386/386, entrypoint 65/65, driver 222/222, CLI 89/89; targeted Pickier, Zig formatting, and staged diff checks pass. Keep #938 OPEN. A separately isolated same-scope class/namespace static-member gap is now tracked in #942: TypeScript emits TS2345+TS2322, while Home emits TS2345+two false TS2339. Pinned Bun WebKit remains absent locally, so no native Bun parity claim. Related #66.

8 days ago

Follow-up to #942: 0cb789b4c is on origin/main under glennmichael123, no coauthors. A single ambient module block containing a class plus same-named namespace now goes through the exact merge collector instead of taking the partial single-origin route; unsupported same-scope pairs remain withheld. Direct and inherited static values match TypeScript 5.9.3 in both source declaration orders on the tested fixture. Program 388/388, entrypoint 66/66, ts_cli 89/89 under the 3840 MB serial guard; checker/driver cached-green from unchanged modules. #942 stays open for streaming/broader acceptance, and #938 remains open for the remaining augmentation surface.

8 days ago

Closed the isolated same-scope class/namespace static-member gap in #942. The fix 0cb789b4c and verification follow-up 4c4e11de5 are both on origin/main. Direct Program, streaming, and CLI-adapter coverage now includes direct/inherited statics, both source declaration orders, and both file-add orders; TypeScript 5.9.3 and Home CLI match the three-error fixture in code/message/location. Latest serial 3840 MB gates: entrypoint 66/66 and ts_cli 89/89 fresh; Program, checker, driver cached-green from previously passing full runs. #938 stays open for the remaining augmentation surface.

8 days ago

Follow-up pushed to origin/main: c57880cd4 closes child #943. It forwards exact source-owned Nested.Box class/namespace static members through named, renamed, star, and chained ambient barrels, including Program streaming and CLI coverage. Competing ambient stars now follow TypeScript's first-owner rule without leaking a dotted augmentation from the losing module; unsupported schema routes remain withheld. Rebuilt Home matches TypeScript 5.7.3 on all six barrel fixtures at diagnostic code/message/location. Guarded gates: Program 392/392, tsc_main 67/67, ts_cli 89/89; checker/driver cached-green. #942 covers the direct same-scope portion. Leaving parent #938 open pending a broader acceptance review; no native Bun parity claim without the pinned WebKit artifact.

8 days ago

Acceptance review on current origin/main c57880c: #942 covers direct same-scope class/namespace statics, and #943 covers named, renamed, star, chained and first-owner barrel routing. The original cross-fragment pkg contract was rechecked today with both declarations in one file and split across two files, using unchanged source behavior and the rebuilt Home CLI versus installed TypeScript 5.7.3 under serial 3840 MB guards. Both layouts match exactly at all three diagnostic codes, messages and locations: TS2322 for the instance literal, TS2322 for the static literal, and TS2345 for the constructor argument; valid reads are silent. Program regression coverage spans fragment/file order, source-owned constructor/instance/static/type routes, streaming, unsupported-schema withholding, collisions and barrel variants. Latest full guarded gates after the child patch: Program 392/392, tsc_main 67/67, ts_cli 89/89; checker/driver cached-green. This proves the specific #938 contract, not full TypeScript or Bun corpus parity. Closing #938 as completed; umbrella #66 remains open.

Sign in to comment on this issue.