Skip to content

Nodes with same content from different locations considered equal #1075

@apiology

Description

@apiology

Parser::AST adds 'location' in Parser::AST::Node on top of its superclass AST::Node, but doesn't overwrite the #hash and #eql?

https://github.com/whitequark/ast/blob/master/lib/ast/node.rb

https://github.com/whitequark/parser/blob/05b88aa0468ce29dfa21e1aff2f0506b1d5d82e1/lib/parser/ast/node.rb

This bit me when I tried to use a node as part of a cache key - is this intended behavior?

See castwide/solargraph#857 for the code in question which triggered this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions