Skip to content

Cannot use complex expressions like hash['foo'] += 1 with hyper-spec #127

Closed
@catmando

Description

@catmando

This is due to an issue in the current unparser gem: mbj/unparser#117

You may get an error like this when running a spec:

(string):1:20: error: unexpected token tOP_ASGN
(string):1: hash.[]("foo") += 1
(string):1: 

The problem is the unparser incorrectly generates hash.[]("foo") += 1 instead of hash['foo'] += 1.

The good news its pretty easy to find such expressions and replace them with something like

hash["foo"] = hash["foo"] + 1

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