Skip to content

Class does not inherit singleton_class's class methods #287

@kachick

Description

@kachick

I have faced a different behavior with MRI/YARV.
Is this expected?

set up

class Foo
  class << self
    class << self
      def foo; end
    end
  end
end

class Bar < Foo; end

Bar.singleton_class.foo

MRI/YARV

ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]

Bar.singleton_class.foo #=> nil

JRuby

jruby 1.7.0.preview2 (1.9.3p203) 2012-09-03 b37a0bd on Java HotSpot(TM) Server VM 1.7.0_07-b10 [linux-i386]

Bar.singleton_class.foo #=> NoMethodError: undefined method `foo' for #<Class:Bar>

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions