Fix type guard additions#2170
Fix type guard additions#2170benlesh merged 5 commits intoReactiveX:masterfrom rob3c:fix-type-guard-additions
Conversation
…rst, last type guard specs
1 similar comment
|
Cc/ @david-driscoll can you review? |
|
I swear I had tried overload ordering the other day to validate if this was possible. I tried again just now and these changes seem to be working just fine. 👍 cc @saneyuki for an extra set of 👀 |
|
@david-driscoll Yep, the ordering is definitely necessary! It wasn't enough, though, so there are some strategic non-optional function parameters in there, too, to help typescript resolve certain cases. |
|
I confirmed that in #2164 we need to write the version which takes Is it resolved in this? The current patches are not care about them. |
|
@saneyuki That's what I originally thought, too. Surprisingly, it turns out that |
|
LGTM |
|
Thanks so much, @rob3c!! |
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description:
This is a fix for the recently-added type guard support in the
filter,find,firstandlastoperator typings. Please see the test cases for details of what's working now, and be sure to let me know if I missed anything this time! ;-)Related issue (if exists):
Apparently, my previous PR in #2119 is being reverted in #2164 due to the important missed case mentioned in #2163. Unfortunately, I didn't receive any notifications about it, but I'm glad I saw it today while lurking through the repo! :-) Hopefully, this PR should address the problem (which I'm embarrased that I missed), and let us keep the new support without breaking previous behavior.