Open kaleidawave opened 1 year ago
Won't go into too much detail here but
Promise
is a Type::SpecialObject
and will get a special implementationStill to implement before closing
@kaleidawave - Is this covered in your currently open PRs? If not I'd like to take a stab at it.
Yeah I hopefully will get Set
, Map
and Promise
type structure working in #146. After that this issue should be finished
Didn't happen in #146.
There exists a mechanism called "lookup/computed generics". It works for subtyping and other places.
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
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 like~and also
Promise
!!! (see #168)~