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
Error when variadic elements generated by generic type and other value make an array #52354
classI<SSextendsstring>{f(){letx: [//Errors when SS is generic and `t` existst: "AAA",
...args: {[SinSS]: [a: number];}[SS]]=["AAA",1];typeSS1=string;lety: [// OK when SS1 is not generict: "AAA",
...args: {[SinSS1]: [a: number];}[SS1]]=["AAA",1];typeSS2="1"|"2"|"3";letz: [// OK when SS2 is not generict: "AAA",
...args: {[SinSS2]: [a: number];}[SS2]]=["AAA",1];letw: [// OK when `t` doesn't exist!!!
...args: {[SinSS]: [a: number];}[SS]]=[1];}}
🙁 Actual behavior
x errors, but w doesn't x errors, but y and z doesn't
Type '["AAA", 1]' is not assignable to type '[t: "AAA", ...args: { [S in SS]: [a: number]; }[SS]]'.
Source provides no match for variadic element at position 1 in target.
Activity
kermanx commentedon Jan 22, 2023
Also, when
SSdefined infinsteadofI, the error still happends.kermanx commentedon Jan 22, 2023
The error message is: