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
{{ message }}
Repository navigation
TS2719 assigning equivalent conditional mapped types returned by a method #1020
Exploration: Yes — compared the reproduction against the pinned Microsoft TypeScript Go compiler and tsrs behaves identically.
Unit Test: No — the behavior matches the upstream reference, so this is not a tsrs-specific parity defect to add a regression test for.
Priority:P3: Narrow or low-impact issue. This matches the upstream reference compiler at the pinned 7.1.0-beta commit, and it only manifests in a specific pattern of generic class + conditional mapped types returned from a private method.
I ran the minimal reproduction with both tsrs 7.1.0-beta.tsrs2 and a freshly built tsgo binary from the pinned commit 3e9236361fa9. Both produced the exact same TS2719 error, including the nested string & K is not assignable to K message. This means the Rust port is not diverging from its upstream target.
I wasn't able to find a fix, but I identified where this is coming from. The diagnostic originates in the upstream TypeScript Go compiler at the pinned 7.1.0-beta commit. The fact that tsgolint 7.0.2004 accepts the code suggests a behavioral change was introduced between 7.0.2004 and 7.1.0-beta. If tsrs should accept this, the change needs to be ported from a later upstream TypeScript commit rather than fixed in tsrs-specific code.
Assigning two equivalent conditional mapped types (returned by a private method) to each other incorrectly produces TS2719 in tsrs 7.1.0-beta.tsrs2. The reporter notes the assignment succeeds in tsgolint 7.0.2004.
TypeScript Go reference: built from triagebot/fix-1020/Cargo.toml commit 3e9236361fa97a9e6c685f4833ac457ae2d8c50a
Go tsc binary: /tmp/triage-1020/tsgo-tsc — reports Version 7.1.0-beta
Commands run
Build tsrs:
cd /home/runner/work/tsrs/tsrs
cargo build --profile dev --locked -p tsrs_cli -p tsrs_testrunner
Build reference TypeScript Go compiler:
cd /tmp/triage-1020/ts-ref/tsc
GOTOOLCHAIN=auto GOWORK=off go build -o /tmp/triage-1020/tsgo-tsc ./cmd/tsc
Run tsrs:
cd /tmp/triage-1020/repro
/home/runner/work/tsrs/tsrs/target/debug/tsrs -p tsconfig.json --pretty false
Run TypeScript Go:
cd /tmp/triage-1020/repro
/tmp/triage-1020/tsgo-tsc -p tsconfig.json --pretty false
Observed outputs
tsrs
repro.ts(11,5): error TS2719: Type '{ [K in keyof S]: K extends string ? Spec<K, S[K]["props"], S[K]["content"]> : never; }' is not assignable to type '{ [K in keyof S]: K extends string ? Spec<K, S[K]["props"], S[K]["content"]> : never; }'. Two different types with this name exist, but they are unrelated.
Type 'K extends string ? Spec<K, S[K]["props"], S[K]["content"]> : never' is not assignable to type 'K extends string ? Spec<K, S[K]["props"], S[K]["content"]> : never'. Two different types with this name exist, but they are unrelated.
Type 'Spec<K, S[K]["props"], S[K]["content"]>' is not assignable to type 'K extends string ? Spec<K, S[K]["props"], S[K]["content"]> : never'.
Type 'Spec<K, S[K]["props"], S[K]["content"]>' is not assignable to type 'Spec<K, S[K]["props"], S[K]["content"]>'. Two different types with this name exist, but they are unrelated.
Type 'string & K' is not assignable to type 'K'.
'string & K' is only assignable to the non-distributed 'K', but 'K' has been distributed here.
EXIT: 2
TypeScript Go reference
repro.ts(11,5): error TS2719: Type '{ [K in keyof S]: K extends string ? Spec<K, S[K]["props"], S[K]["content"]> : never; }' is not assignable to type '{ [K in keyof S]: K extends string ? Spec<K, S[K]["props"], S[K]["content"]> : never; }'. Two different types with this name exist, but they are unrelated.
Type 'K extends string ? Spec<K, S[K]["props"], S[K]["content"]> : never' is not assignable to type 'K extends string ? Spec<K, S[K]["props"], S[K]["content"]> : never'. Two different types with this name exist, but they are unrelated.
Type 'Spec<K, S[K]["props"], S[K]["content"]>' is not assignable to type 'K extends string ? Spec<K, S[K]["props"], S[K]["content"]> : never'.
Type 'Spec<K, S[K]["props"], S[K]["content"]>' is not assignable to type 'Spec<K, S[K]["props"], S[K]["content"]>'. Two different types with this name exist, but they are unrelated.
Type 'string & K' is not assignable to type 'K'.
'string & K' is only assignable to the non-distributed 'K', but 'K' has been distributed here.
EXIT: 2
Result
NOT REPRODUCED as a tsrs parity defect.
The checked-out tsrs produces exactly the same TS2719 diagnostic as the pinned Microsoft TypeScript Go compiler (3e9236361fa9). The reporter's observation that tsgolint 7.0.2004 accepts the code indicates an upstream change between that build and the pinned 7.1.0-beta commit, not a divergence in the Rust port.
This report was made by an LLM. The analysis may be wrong, and the potential fix might not work, but is intended as a starting point for exploring the issue.
Correction: my comparison used different compiler versions. Latest tsgolint 7.0.2007 targets TypeScript 7.0.2, while tsrs 7.1.0-beta.tsrs2 targets 7.1.0-beta. Upgrading tsgolint still leaves the same two TS2719 differences in our repo, with all ten lint warnings identical, but that is not a version-matched comparison. The matched-revision test in the triage above reproduces TS2719 in Go too, so this does not establish a tsrs-specific defect. Closing; thanks for checking, and sorry for the misleading attribution.
Activity
oxc-captain commentedon Nov 17, 2026
7.1.0-betacommit, and it only manifests in a specific pattern of generic class + conditional mapped types returned from a private method.I ran the minimal reproduction with both
tsrs 7.1.0-beta.tsrs2and a freshly builttsgobinary from the pinned commit3e9236361fa9. Both produced the exact same TS2719 error, including the nestedstring & Kis not assignable toKmessage. This means the Rust port is not diverging from its upstream target.I wasn't able to find a fix, but I identified where this is coming from. The diagnostic originates in the upstream TypeScript Go compiler at the pinned
7.1.0-betacommit. The fact thattsgolint 7.0.2004accepts the code suggests a behavioral change was introduced between7.0.2004and7.1.0-beta. If tsrs should accept this, the change needs to be ported from a later upstream TypeScript commit rather than fixed in tsrs-specific code.Full Triage Report
Triage Report: Issue #1020
Issue claim
Assigning two equivalent conditional mapped types (returned by a private method) to each other incorrectly produces TS2719 in tsrs
7.1.0-beta.tsrs2. The reporter notes the assignment succeeds in tsgolint7.0.2004.Minimal input
Created at
/tmp/triage-1020/repro:repro.ts:tsconfig.json:{"compilerOptions":{"strict":true,"noEmit":true,"target":"ESNext","module":"ESNext","types":[]},"include":["repro.ts"]}Compiler revisions
7.1.0-beta.tsrs2, pinnedmicrosoft/TypeScript@3e9236361fa97a9e6c685f4833ac457ae2d8c50atriagebot/fix-1020/Cargo.tomlcommit3e9236361fa97a9e6c685f4833ac457ae2d8c50atscbinary:/tmp/triage-1020/tsgo-tsc— reportsVersion 7.1.0-betaCommands run
Build tsrs:
cd /home/runner/work/tsrs/tsrs cargo build --profile dev --locked -p tsrs_cli -p tsrs_testrunnerBuild reference TypeScript Go compiler:
cd /tmp/triage-1020/ts-ref/tsc GOTOOLCHAIN=auto GOWORK=off go build -o /tmp/triage-1020/tsgo-tsc ./cmd/tscRun tsrs:
Run TypeScript Go:
Observed outputs
tsrs
TypeScript Go reference
Result
NOT REPRODUCED as a tsrs parity defect.
The checked-out tsrs produces exactly the same TS2719 diagnostic as the pinned Microsoft TypeScript Go compiler (
3e9236361fa9). The reporter's observation that tsgolint7.0.2004accepts the code indicates an upstream change between that build and the pinned7.1.0-betacommit, not a divergence in the Rust port.This report was made by an LLM. The analysis may be wrong, and the potential fix might not work, but is intended as a starting point for exploring the issue.
nperez0111 commentedon Nov 17, 2026
Correction: my comparison used different compiler versions. Latest tsgolint 7.0.2007 targets TypeScript 7.0.2, while tsrs 7.1.0-beta.tsrs2 targets 7.1.0-beta. Upgrading tsgolint still leaves the same two TS2719 differences in our repo, with all ten lint warnings identical, but that is not a version-matched comparison. The matched-revision test in the triage above reproduces TS2719 in Go too, so this does not establish a tsrs-specific defect. Closing; thanks for checking, and sorry for the misleading attribution.