Skip to content

'test' key in source hash breaks RecursiveOpenStruct ros['test'] or ros[:test] #42

@SaltwaterC

Description

@SaltwaterC

Hi.

require 'recursive-open-struct'

foo = {
  test: :bar
}

ros = RecursiveOpenStruct.new foo

# p ros.test
p ros[:test]
p ros['test']

Crashes in flames with:

recursive_open_struct.rb:42:in `test': wrong number of arguments (0 for 2..3) (ArgumentError)
recursive_open_struct.rb:42:in `[]'

I've left ros.test method call in there as uncommenting that line auto-magically fixes the code and it outputs the expected:

:bar
:bar
:bar

This issue appeared with 1.0.0 while 0.6.5 works properly. I still don't know what's so special about "test" as key as this is the only way I could reproduce the bug.

Cheers!

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions