Skip to content

Primitive_object.equal treats empty array as Some(None) #8234

@zth

Description

@zth

It appears that Primitive_object.equal mistakenly treats [] as Some(None). I can't think of a reason for this being intentional, so I think it's a bug.

This ReScript code logs true:

let check = v => v == Some(None)

Console.log(check(%raw(`[]`)))

But an empty array is not Some(None), so it should be logging false.

Playground: https://rescript-lang.org/try/?version=v12.0.0-rc.1&module=esmodule&code=DYUwLgBAxgFiUGsIF4IDcUD50tQZQHsBbEACgDkCA7EASgCh6BhagZwNADpgCBzU2PASkApACcAhgHdSAAwDaAXVm1VQA

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