-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
structural and shallow comparers have false positives for different collection types #2239
Comments
It seems intentional, but I don't think it's useful - I can't imagine What also seems troubling is treating EDIT: ...and the same goes for |
I think the set case is just an oversight, as they have been bolted on later. PRs to fix welcome! cc @auvipy this is a nicely limited scoped PR if you want to get hands on :) |
Sure thing, I raised a PR here (I should have mentioned it in the description): |
Fixed in (4/5).15.2. |
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 or questions. |
A comparison of different collection types should presumably always fail. For example, both of these comparisons should presumably fail:
However, both pass.
eq
unwraps ES6 collection types to Arrays before the same-type test, which produces those false equalities:mobx/src/utils/eq.ts
Lines 30 to 33 in 3fe3ada
This can presumably be fixed by moving the unwrapping to after the same-type test.
The text was updated successfully, but these errors were encountered: