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
Part of #80. Deferred — track only, do not start until Phase 1 (errors baseline) is shipped, stable, and we have evidence the deferred work is worth doing.
Context
#83 deliberately punts on lib resolution: when a conformance test sets // @lib: es2015,dom, our runner ignores the directive and the type checker uses its hard-coded SharpTS defaults. This is a pragmatic Phase-1 decision but it has real consequences:
The Pass bucket means "SharpTS happens to coincide with tsc on this input," not "SharpTS matches tsc semantically."
DOM tests (tests/cases/conformance/jsx/, anything that imports document/HTMLElement) are wholesale blocked.
This issue tracks the eventual fix: parse tsc's lib.*.d.ts files (vendored at external/typescript/src/lib/) into the type checker so it sees the same world model tsc does for each test.
Why deferred
Big lift, blocks delivery. The lib files are large (es5.d.ts = 4,567 lines, dom.generated.d.ts = 28,578 lines, ~33k for a typical es5+dom test). They use dense TS — declaration merging, ambient modules, complex generic / conditional / mapped types — and parsing them will surface latent bugs in our parser/checker.
No code path today. SharpTS globals are hard-coded in TypeChecker.*.cs partials, not loaded from any .d.ts. Switching to file-loaded globals is a structural refactor of the type checker, not a feature addition.
Phase 1 needs to ship first. We need the runner to actually surface what's failing before we know whether lib plumbing is the bottleneck or whether other type-checker bugs dominate the divergence.
What this would unlock
Type-B test failures become real signal instead of Skipped.
DOM, WebWorker, and lib-conditional tests stop being effectively unrunnable.
Removes the asterisk on "SharpTS conformance" — Pass would mean what it says.
Pre-conditions before picking up
Phase 1 baseline is committed and stable for at least one release cycle.
The lib-drift skip filter has produced a list of tests it's hiding — quantify the type-B problem before solving it.
We've decided whether SharpTS wants to support multiple --lib choices (matches tsc) or pick one frozen lib version. The former is genuinely complex.
Out of scope
Self-hosting SharpTS implementations in TS. Conflated with this idea in earlier discussion but unrelated. Built-in implementations stay in C# (perf, bootstrapping, can't self-host Math.sqrt/Date.now etc.). This issue is about signatures only — what the type checker knows, not what runs at runtime.
Reference
external/typescript/src/lib/ — the vendored lib files at the pinned TS tag.
TypeSystem/TypeChecker.Properties.cs, TypeSystem/TypeCategoryResolver.cs — where current hard-coded global resolution lives.
Runtime/BuiltIns/ — implementations (out of scope for this issue, stay in C#).
Part of #80. Deferred — track only, do not start until Phase 1 (errors baseline) is shipped, stable, and we have evidence the deferred work is worth doing.
Context
#83 deliberately punts on lib resolution: when a conformance test sets
// @lib: es2015,dom, our runner ignores the directive and the type checker uses its hard-coded SharpTS defaults. This is a pragmatic Phase-1 decision but it has real consequences:Passbucket means "SharpTS happens to coincide withtscon this input," not "SharpTS matchestscsemantically."Skippedvia the lib-drift filter rather thanFail. Real signal is lost.tests/cases/conformance/jsx/, anything that importsdocument/HTMLElement) are wholesale blocked.This issue tracks the eventual fix: parse
tsc'slib.*.d.tsfiles (vendored atexternal/typescript/src/lib/) into the type checker so it sees the same world modeltscdoes for each test.Why deferred
es5.d.ts= 4,567 lines,dom.generated.d.ts= 28,578 lines, ~33k for a typical es5+dom test). They use dense TS — declaration merging, ambient modules, complex generic / conditional / mapped types — and parsing them will surface latent bugs in our parser/checker.TypeChecker.*.cspartials, not loaded from any.d.ts. Switching to file-loaded globals is a structural refactor of the type checker, not a feature addition.What this would unlock
Skipped.*.types/*.symbolsbaseline) for direct success — that work needs identical world models on both sides.Passwould mean what it says.Pre-conditions before picking up
--libchoices (matchestsc) or pick one frozen lib version. The former is genuinely complex.Out of scope
Math.sqrt/Date.nowetc.). This issue is about signatures only — what the type checker knows, not what runs at runtime.Reference
external/typescript/src/lib/— the vendored lib files at the pinned TS tag.TypeSystem/TypeChecker.Properties.cs,TypeSystem/TypeCategoryResolver.cs— where current hard-coded global resolution lives.Runtime/BuiltIns/— implementations (out of scope for this issue, stay in C#).