Skip to content

Avoid duplicate empty runtime containers for ambient namespaces - #440

Merged
CaelmBleidd merged 1 commit into
neofrom
caelmbleidd/ts-ambient-namespace-containers
Oct 15, 2026
Merged

CaelmBleidd merged 1 commit into
neofrom
caelmbleidd/ts-ambient-namespace-containers

Conversation

@CaelmBleidd

Copy link
Copy Markdown
Member

Repeated export declare namespace Sink declarations in the real TylorS/typed source graph each produced an executable synthetic %dflt class with the same full signature. USVM built the hierarchy for an unrelated VersionedTransform entry and aborted during initial-state construction with List has more than one element.

Ambient namespaces are erased by TypeScript. Do not synthesize an executable default initializer for them, and omit their empty default container when the namespace contains only type/class declarations. Keep all namespace and class/interface metadata, plus ambient function and variable declarations. Detect inherited ambient context and declaration files. Ordinary runtime namespace initializers retain their existing representation.

This is deliberately limited to ambient namespace initialization. It does not select an arbitrary duplicate runtime class or claim complete namespace declaration merging. The active experiment runtime and frozen sources are unchanged.

Validation:

  • Five focused source regressions pass, covering repeated and nested ambient namespaces, declaration files, ambient value metadata, and runtime namespace initializers.
  • Four of those tests fail against the unchanged base implementation; the runtime namespace control still passes.
  • TypeScript typecheck and git diff --check pass.
  • No engine run, full suite, or native replay coverage claim is included in this MR.

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

  247 files  ±0    247 suites  ±0   14m 45s ⏱️ -1s
  892 tests ±0    880 ✅ ±0  12 💤 ±0  0 ❌ ±0 
2 162 runs  ±0  2 112 ✅ ±0  50 💤 ±0  0 ❌ ±0 

Results for commit ef70a5c. ± Comparison against base commit 1260b68.

♻️ This comment has been updated with latest results.

@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/ts-ambient-namespace-containers branch from de3229b to ef70a5c Compare October 15, 2026 08:30
@CaelmBleidd
CaelmBleidd merged commit dcaba41 into neo Oct 15, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant