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
No-op mapped type not assignable; but original type is assignable #38235
typeFoo<IdentifierTextendsRecord<PropertyKey,PropertyKey>>=IdentifierT;typeBar<IdentifierTextendsRecord<PropertyKey,PropertyKey>,T>={[kinkeyofT] : Foo<IdentifierT&{k : k}>};typeMerge2<T>={[kinkeyofT] : T[k]}typeBar2<IdentifierTextendsRecord<PropertyKey,PropertyKey>,T>={[kinkeyofT]: Foo<Merge2<IdentifierT&{k: k}>>// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// Works in 3.5.1// Works in 3.6.3// Works in 3.7.5// Fails in 3.8.3};typeIdentity<T>=T;typeMerge3<T>=Identity<{[kinkeyofT] : T[k]}>typeBar3<IdentifierTextendsRecord<PropertyKey,PropertyKey>,T>={[kinkeyofT]: Foo<Merge3<IdentifierT&{k: k}>>// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// Works in 3.5.1// Works in 3.6.3// Works in 3.7.5// Fails in 3.8.3};
I think I have the same issue with https://github.com/phiresky/ts-typed-sql, which destroys type inference everywhere, means our whole project is stuck on 3.7 for now :(
Activity
phiresky commentedon May 16, 2020
I think I have the same issue with https://github.com/phiresky/ts-typed-sql, which destroys type inference everywhere, means our whole project is stuck on 3.7 for now :(
AnyhowStep commentedon May 21, 2020
I've been stuck at 3.5.1 forever now =(
phiresky commentedon May 23, 2020
I just bisected the ts compiler to find the cause using
build.sh
bisect reports:
first bad commit: [357f715] Check combined intersection properties against target index signatures (#35143) by Anders Hejlsberg (@ahejlsberg)
ahejlsberg commentedon May 24, 2020
A simpler repro for this issue:
We shouldn't error above and strangely we don't if the declaration of
Foois changed toThat's definitely a bug.
The example above worked before #35143 because we were very lax in our checking of relations involving intersections on the source side.