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
Actually your example doesn't work in 3.8.3. Add the omitted first argument in the functions like bus.pipe(map((x) => ``), map((x) => [true]), map((x) => [``]), map((x) => false)); and these x will still be inferred as number.
And I would suggest using variadic arguments as workaround.
whzx5byb yes, you are right, doesn't seems to ever worked. Unfortunately variadic arguments is not an option because in my code I want to use few more arguments after pipes.
Activity
whzx5byb commentedon Jan 12, 2022
Actually your example doesn't work in 3.8.3. Add the omitted first argument in the functions like
bus.pipe(map((x) => ``), map((x) => [true]), map((x) => [``]), map((x) => false));and thesexwill still be inferred asnumber.And I would suggest using variadic arguments as workaround.
Playground
Flairax commentedon Jan 12, 2022
whzx5byb yes, you are right, doesn't seems to ever worked. Unfortunately variadic arguments is not an option because in my code I want to use few more arguments after pipes.
Because of this such solution is also not fitting
Thanks anyway :)
RyanCavanaugh commentedon Jan 12, 2022
I don't understand what the actual vs expected problem is. Can you state it more clearly?
Flairax commentedon Jan 12, 2022
Ryan Cavanaugh (@RyanCavanaugh), changed description in whzx5byb way. Think it more clearer now.
RyanCavanaugh commentedon Jan 13, 2022
Thanks, that's much clearer.
Generic inference has a fixed number of passes for fixing type parameters and isn't capable of inferring this sort of pattern.
See also #30134