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
Something about this and not being able to infer Q from the type T & Iterable<Q> in this scenario. (Workaround: replace Q with or constrain Q to (T extends Iterable<infer I> ? I : never))
Not sure if this is really a bug or what. Seems like it might be a breaking change for Bluebird, though.
letx1=foo1(sa);// stringlety1=foo1(sx);// unknownletx2=foo2(sa);// string[]lety2=foo2(sx);// { extra: number }
It's pretty clear that x1 and y2 are inconsistent, and unknown would be a better inference for x2.
With 3.6.0-dev.20190725 we produce:
letx1=foo1(sa);// unknownlety1=foo1(sx);// unknownletx2=foo2(sa);// unknownlety2=foo2(sx);// { extra: number }
This has the better inference for x2 and it makes x1 and y1 consistent, but unknown is really not a good inference here. I think the desired outcome is:
letx1=foo1(sa);// stringlety1=foo1(sx);// stringletx2=foo2(sa);// unknownlety2=foo2(sx);// { extra: number }
I have updated #32558 to implement this and I'm currently checking for effects on the DT tests.
TypeScript Version: 3.4.0-dev.201xxxxx
Search Terms:
Code
this code work at
3.5.2
and3.6.0-dev.20190704
but fail at
3.6.0-dev.20190725
Expected behavior:
no error and infer to
string
Actual behavior:
vvvv infer to
unknown
Playground Link:
Related Issues:
The text was updated successfully, but these errors were encountered: