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

No #define_method on main object #2449

Closed
chrisseaton opened this issue Jan 11, 2015 · 2 comments
Closed

No #define_method on main object #2449

chrisseaton opened this issue Jan 11, 2015 · 2 comments

Comments

@chrisseaton
Copy link
Contributor

This works on MRI, but not sure why

define_method :bar do
end

Where does it get define_method from? Works on MRI 2.2, Rbx 2.1.4, but not on JRuby 1.7 or master.

@cremno
Copy link

cremno commented Jan 11, 2015

It isn't Module#define_method, it's directly defined on top self/main object (for some reason).

https://github.com/ruby/ruby/blob/6b6ba319ea4a5afe445bad918a214b7d5691fd7c/proc.c#L2779-L2780
https://bugs.ruby-lang.org/issues/6609

@headius
Copy link
Member

headius commented Jan 12, 2015

@cremno Good find, thank you!

@headius headius added this to the JRuby 9.0.0.0-pre1 milestone Jan 12, 2015
@headius headius self-assigned this Jan 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants