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
Immutable incorrectly changes tuples to ReadonlyArray. For example:
import{Immutable}from'@pacote/immutable'typeImmutableTuple=Immutable<[number,string]>// expected => Readonly<[number, string]>// actual => ReadonlyArray<number | string>consttest: ImmutableTuple=['string',1]// this should be failing compilation
The correct behaviour is for Immutable<[number, string]> to become Readonly<[number, string]>.
The text was updated successfully, but these errors were encountered:
The way tuples are implemented in typescript, I don't believe there is a way to do this except for declaring an internal type for each of the different arity tuples explicitly and then use a union type for the exported type. Even so I don't know if at the call site the compiler can differentiate the cases correctly.
Immutable
incorrectly changes tuples toReadonlyArray
. For example:The correct behaviour is for
Immutable<[number, string]>
to becomeReadonly<[number, string]>
.The text was updated successfully, but these errors were encountered: