From: kevin.deisz@... Date: 2019-01-03T14:15:54+00:00 Subject: [ruby-core:90872] [Ruby trunk Bug#15501] private_methods(false) changes behavior based on singleton class allocation Issue #15501 has been reported by kddeisz (Kevin Deisz). ---------------------------------------- Bug #15501: private_methods(false) changes behavior based on singleton class allocation https://bugs.ruby-lang.org/issues/15501 * Author: kddeisz (Kevin Deisz) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: * Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- ~~~ ruby class Module prepend Module.new end module Foo end p Foo.private_methods(false) # => [:remove_const, :method_added, :method_removed, :method_undefined, :prepend_features, :extend_object, :refine, :using, :append_features, :initialize, :initialize_clone, :initialize_copy, :public, :private, :module_function, :protected, :included, :extended, :prepended] Foo.singleton_class p Foo.private_methods(false) # => [] ~~~ I have no idea what is causing this, but I tested it and it looks like this goes back to at least 2.1.5. It looks like before the singleton class is allocated `private_methods(false)` returns a whole host of methods, while after it returns the expected output. Any help/advice would be appreciated. -- https://bugs.ruby-lang.org/ Unsubscribe: