Actions
Bug #16942
closedinstance_method causes an infinite loop with prepend, include and private
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.8.0dev (2020-06-09T13:51:54Z master 7f3efee102) [x86_64-linux]
Description
instance_method
causes an infinite loop with the following code.
module M
def x
end
end
module M2
include M
private :x
end
::Object.prepend(M2)
# infinite loop
p Object.instance_method(:x)
I've confirmed it on the master branch. The commit is 7f3efee102.
But instance_method
works correctly with Ruby 2.7.1.
Actions
Like0
Like0Like0Like0Like0