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
Every Js.Date is equal to every other Js.Date #3455
Comments
hi, |
More details on the unsafety here https://blog.janestreet.com/the-perils-of-polymorphic-compare/ |
For reference: this is the point where dates would be handled: After |
It makes sense to make the default less surprising, we are going to have this fixed in next release |
One option to kind of cover this and other surprises with polymorphic compares is to by default enable 102 as a warning. Actually, now that I think about it, I want to propose some stricter warnings and errors by default anyway. I'll open a separate issue. |
@yawaramin it used to be default, but people don't like it .. |
@bobzhang that makes sense actually–I had it turned on for a bit and realized it's not great because the warning doesn't go away–it keeps appearing even if the file isn't touched afterwards 😅 |
Using
==
in Reason (or=
in OCaml), allJs.Date.t
values are equal:I tried looking through the
caml_equal
function, but I got a bit lost. :)The text was updated successfully, but these errors were encountered: