sindresorhus / type-fest

A collection of essential TypeScript types
Creative Commons Zero v1.0 Universal
14.42k stars 548 forks source link

``ArrayTail`` doesn't work when mixed with optional elements #978

Open ferferga opened 2 weeks ago

ferferga commented 2 weeks ago

Bug description

This type:

type Test = ArrayTail<[foo?: string | undefined, bar?: number | undefined]>;

Is resolved as []

Repro

https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBDAnmApnA3nAglKBDRAFT2ABs4BfOAMyghDgHIlUBaalAZxkYG4BYAFBDqAVwB2AYxjAI4hFxgAKahAgB+AFxxuUYOIDmAGjgAjPFC1xxokKZRQAlBiEBIKChiio4gYIpCQgD0QXCEABbAnHAenBCkAG5cCBBwANqqGtq6+gZwAD5wEgAmKNT6KMUm5pbaNnYOBUXipeXilQC6QixoAGIS0rLiAAoWeCDRALxwo-ggng6cADw9ENQK3AB8fsGhEVE64RCipMUxXPFJKek1VvX2UE0lZRXFXYI9YcgovYrEZHBpjh8EQSKQlv0pDI5LNxpxtoFBCEwpFop9ygAPZIwcJoMAeBKyUTRKKcUQobrfOC9YBY4r-cEAGU2gLgjLgKAxMBQLWiHjwxTkpEQ6Q6cHUbLg2nZnO5vPOAqFIrSEgA1uIIAB3cTqEwAOgN+g4j0ZDLFEtNYKlbJ2SNCACULolknhomlbnVbA8ni0Xu03nBJNAPNJhZTUHAAOrAHE0ukM1lxyoMiEDaEjMYTbZAA

Upvote & Fund

Fund with Polar