Skip to content

Equality check on Json.Decode.oneOf always returns true #904

@shuhei

Description

@shuhei

Currently any pair of oneOf decoders are equal in the equality check that is used for diffing in virtual-dom. Because of this, changes in oneOf decoders are not reflected in event handlers of DOMs. (An example on Ellie)

Equality of two oneOf decoders are checked with _Json_listEquality(), which expects JavaScript arrays of decoders. However, a oneOf decoder has an Elm List of decoders instead of a JavaScript Array. Because of this, the len variable below becomes undefined given oneOf decoders, and the function always returns true for oneOf decoders.

https://github.com/elm-lang/core/blob/bc067c8e3db20235fc275b1d825bb76f365a1509/src/Elm/Kernel/Json.js#L378-L398

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions