Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Struct strange output #361

Open
StefanoMartin opened this issue May 29, 2019 · 1 comment · May be fixed by #363
Open

Struct strange output #361

StefanoMartin opened this issue May 29, 2019 · 1 comment · May be fixed by #363

Comments

@StefanoMartin
Copy link

StefanoMartin commented May 29, 2019

I noticed a strange behavior when I use awesome print with Struct and one of the attribute is ":s"+other_attribute.

Here an example:

require "awesome_print"
require "ostruct"

A = Struct.new(:a, :sa)
ap A.new(1,2)

===> 
#<Struct:A:0x5561e5934cd8
    a = 1,
    attr_accessor :a = 2
>

Instead of the expected:

#<Struct:A:0x5561e5934cd8
    a = 1,
    sa = 2
>
@randyjap randyjap linked a pull request Jun 5, 2019 that will close this issue
@randyjap
Copy link

randyjap commented Jun 5, 2019

This appears to be caused by an indexing error into the variables.
I have opened a PR to fix this.
#363

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants