-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
types inferring problem with scan operator #3150
Comments
Probably related to #2897. See discussion therein. |
Oh sorry, I missed that. But now there is a game changer as it's causing errors. I'll dig into typescripts issues see if I can find something. |
I thought the problem was because I updated my ts but it's not, it's because I refactored my code to use pipe. I found this new issue microsoft/TypeScript#20305 but I'm not sure it's exactly the same problem. |
This has been addressed to the best of our ability in RxJS 7. |
I'm having a problem when using
scan
with 2 different type for item and accumulator/seed on ts 2.5+ (didn't try older versions).You can see it here : https://stackblitz.com/edit/ts-fn-overload-bug?file=test.ts
gives the following error :
Even if scan has a signature matching that use case (the last one) :
As it's shown on the stackblitz, order seems to matter so it's most likely a ts bug.
But looking closely on those types, @NaridaL pointed out that the last signature should be enough to cover all cases. Indeed
R
can totally be inferred with the same type asT
orT[]
.So the question is : is there any reason for having those subtype signatures ? especially since now it seems to create a bug ?
P.S: Couldn't find a corresponding ts issue but didn't do much digging
P.S2: I think the same applies for
reduce
.The text was updated successfully, but these errors were encountered: