Skip to content

GreenNode equality and hashing mismatch #449

@LilithHafner

Description

@LilithHafner
julia> x = JuliaSyntax.parse(JuliaSyntax.GreenNode, "1 + 1")
     1:5      │[call]
     1:1      │  Integer                ✔
     2:2      │  Whitespace
     3:3      │  +                      ✔
     4:4      │  Whitespace
     5:5      │  Integer                ✔


julia> y = JuliaSyntax.parse(JuliaSyntax.GreenNode, "1 + 1")
     1:5      │[call]
     1:1      │  Integer                ✔
     2:2      │  Whitespace
     3:3      │  +                      ✔
     4:4      │  Whitespace
     5:5      │  Integer                ✔


julia> x == y
true

julia> hash(x) == hash(y)
false

This makes Dicts broken.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions