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
we infer T to be {}. The first argument is assignable to {}[] and the second argument is assignable to {}, so the call succeeds. This is unexpected and basically wrong.
If instead we only used the type parameters from function arguments when there were no other candidates for a given type parameter, we would infer T to be number and the call would be correctly rejected.
Not done yet: Actual spec work, thinking it through all the way, testing against existing code.
The text was updated successfully, but these errors were encountered:
This is a rough sketch so I have something to refer to.
Currently, we treat the two instances of
T
in the parameter list here equally:This means that when we make a call like this:
we infer
T
to be{}
. The first argument is assignable to{}[]
and the second argument is assignable to{}
, so the call succeeds. This is unexpected and basically wrong.If instead we only used the type parameters from function arguments when there were no other candidates for a given type parameter, we would infer
T
to benumber
and the call would be correctly rejected.Not done yet: Actual spec work, thinking it through all the way, testing against existing code.
The text was updated successfully, but these errors were encountered: