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
{{ message }}
Repository navigation
Array/Observable filter does not infer chained type #19640
This worked with TS ~2.3 and is not working anymore with TS ~2.6. I thought the above would be a simpler reproduction but it seems it is something completely different :) Thanks for your hint though, this helps but still required quite a few new guards in our codebase which worked in a previous TS version 😕
You're right doesn't work on arrays, we do have some rxjs observables where this works though, no idea what exactly is different there or if it's project specific.. I will report back later this week.
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.
Activity
topaxi commentedon Nov 1, 2017
I noticed this by a different case actually, probably should have posted that one.
This worked with TS ~2.3 and is not working anymore with TS ~2.6. I thought the above would be a simpler reproduction but it seems it is something completely different :) Thanks for your hint though, this helps but still required quite a few new guards in our codebase which worked in a previous TS version 😕
topaxi commentedon Nov 1, 2017
You're right doesn't work on arrays, we do have some rxjs observables where this works though, no idea what exactly is different there or if it's project specific.. I will report back later this week.
typescript-bot commentedon Nov 17, 2017
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.
wclr commentedon Jan 17, 2018
Not sure why this not working:
Tried latest dev 2.7 still not working and not inferring
mhegazy commentedon Jan 17, 2018
A user-defined type guard is not inferred automatically, a type annotation is expected. i.e.:
wclr commentedon Jan 17, 2018
It is good to hear, but still complicated, not clear whey it not possible to have auto inference here.