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

9k has different scoping behavior than MRI #3010

Closed
zachpendleton opened this Issue Jun 1, 2015 · 3 comments

Comments

Projects
None yet
3 participants
@zachpendleton
Copy link

zachpendleton commented Jun 1, 2015

Issue w/ test available here: https://gist.github.com/zachpendleton/e7f1352f4bd079daf288

If attr_accessor is called inside a protected or private method, the instance variables inherit the protected or private scope in 9k, but in MRI they inherit the scope of the call site.

@lephyrius

This comment has been minimized.

Copy link

lephyrius commented Jun 2, 2015

👍 I think I got the same problem here.
#2886
But I couldn't create a nice testcase like u.

@headius

This comment has been minimized.

Copy link
Member

headius commented Jun 2, 2015

Ah I see. Yes, method bodies should always default to public visibility, I believe.

@headius

This comment has been minimized.

Copy link
Member

headius commented Jun 2, 2015

I see the issue... InterpretedIRMethod is always using that method's visibility when preparing the frame. It should just be left as the default public visibility. Fixing.

@headius headius closed this in 2bd4280 Jun 2, 2015

headius added a commit that referenced this issue Jun 2, 2015

@headius headius added core jit ir labels Jun 2, 2015

@headius headius added this to the JRuby 9.0.0.0.rc1 milestone Jun 2, 2015

headius added a commit to ruby/spec that referenced this issue Jun 3, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.