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
Lookup generics is manually set, it would be good if it could infer for any array (via trying to find a member, preferable contravariant else covariant for some edge cases).
Will test for Map & Set soon.
Proxy is a different issue #33 and Promises are different #168
kaleidawave
changed the title
Look generics for collection types & more
Lookup/computed generics for collection types & more
Jun 20, 2024
Given an array like
It is typed (or will be as
{ [0]: 1, [1]: 4, [2]: "item" }
). The problem is how to reference its prototype.Array is a generic structure so it could be
Array<1 | 4 | "item">
. However it would have to be modified every push...It is needed to test equality
Alternatively the
T
type could be figured out from items. Along the lines ofinterface Array<T is this[number]>
...This also affects
Set
,Map
, which could be done likeand alsoPromise
!!! (see #168)The text was updated successfully, but these errors were encountered: