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

Module#public does not follow method redefinition #2356

Open
headius opened this issue Dec 29, 2014 · 0 comments
Open

Module#public does not follow method redefinition #2356

headius opened this issue Dec 29, 2014 · 0 comments

Comments

@headius
Copy link
Member

headius commented Dec 29, 2014

From http://jira.codehaus.org/browse/JRUBY-3917 filed by @shugo.

Module#public does not follow method redefinition.

  class Foo
    private
    def foo
      p :foo
    end
  end

  class Bar < Foo
    public :foo
  end

  class Foo
    def foo
      p :redefined
    end
  end

  b = Bar.new
  b.foo # :foo, but it should be :redefined

FYI, in CRuby, NODE_ZSUPER is used to implement it. Futhermore, Kernel#method and Module#instance_method return the method of the superclass to hide NODE_ZSUPER.

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

1 participant