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.
Activity
jcalz commentedon Jul 26, 2019
Ideally bug reports will have a completely self-contained example that you don't need external libraries to reproduce. Like maybe this:
Playground (but there's no error in v3.5.1)
Something about
thisand not being able to inferQfrom the typeT & Iterable<Q>in this scenario. (Workaround: replaceQwith or constrainQto(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.
Caused by #32386/#32460? (🃏wild guess❓)
ahejlsberg commentedon Jul 26, 2019
This is caused by #32460. Consider the following simplified example:
With 3.5.x we produced the following results:
It's pretty clear that
x1andy2are inconsistent, andunknownwould be a better inference forx2.With 3.6.0-dev.20190725 we produce:
This has the better inference for
x2and it makesx1andy1consistent, butunknownis really not a good inference here. I think the desired outcome is:I have updated #32558 to implement this and I'm currently checking for effects on the DT tests.