Skip to content

@auto_hash_equals ignores fields declared in begin...end #29

@gafter

Description

@gafter

I don't know why anyone would do this, but it is legal in Julia (at least, the compiler accepts it) and it breaks @auto_hash_equals

module In0

using AutoHashEquals

@auto_hash_equals struct Q
    x::Int
    begin
    y::Int
    end
end

println(hash(Q(1, 2)))
println(hash(Q(1, 3)))
println(Q(1, 2) == Q(1, 3))

end

These two differently-valued instances of Q are treated as equal to each other.

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