Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upEquality check on Json.Decode.oneOf always returns true #904
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
process-bot
Sep 2, 2017
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!
Here is what to expect next, and if anyone wants to comment, keep these things in mind.
process-bot
commented
Sep 2, 2017
|
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it! Here is what to expect next, and if anyone wants to comment, keep these things in mind. |
shuhei
referenced a pull request that will
close
this issue
Sep 2, 2017
Open
Fix equality check of oneOf decoder #905
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
shuhei commentedSep 2, 2017
•
edited
Edited 1 time
-
shuhei
edited Sep 3, 2017 (most recent)
Currently any pair of
oneOfdecoders are equal in the equality check that is used for diffing in virtual-dom. Because of this, changes inoneOfdecoders are not reflected in event handlers of DOMs. (An example on Ellie)Equality of two
oneOfdecoders are checked with_Json_listEquality(), which expects JavaScript arrays of decoders. However, aoneOfdecoder has an ElmListof decoders instead of a JavaScriptArray. Because of this, thelenvariable below becomesundefinedgivenoneOfdecoders, and the function always returnstrueforoneOfdecoders.https://github.com/elm-lang/core/blob/bc067c8e3db20235fc275b1d825bb76f365a1509/src/Elm/Kernel/Json.js#L378-L398