Project

General

Profile

Bug #11064

#singleton_methods for objects with special singleton_class returns an empty array

Added by rbjl (Jan Lelis) over 4 years ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
[ruby-core:<unknown>]

Description

def nil.bla
  42  
end

# works
nil.bla #=> 42
nil.singleton_method(:bla) #=> #<Method: NilClass#bla>
NilClass.instance_methods.include? :bla #=> true

# does not work
nil.singleton_methods #=> []

Also available in: Atom PDF