Bug #9138

make initialize_copy private

Added by Zachary Scott 5 months ago. Updated 4 months ago.

[ruby-core:58488]
Status:Assigned
Priority:Normal
Assignee:Zachary Scott
Category:-
Target version:next minor
ruby -v:2.1.0dev Backport:1.9.3: UNKNOWN, 2.0.0: UNKNOWN

Description

it was discussed with nobu that initialize_copy should be a private method, and any cases where it's public is considered a bug.

when i asked matz he said, it sounds good and ok to experiment with this change in trunk.

History

#1 Updated by Zachary Scott 4 months ago

  • Target version set to next minor

Going to postpone this until 2.2

#2 Updated by Marc-Andre Lafortune 4 months ago

Isn't initialize_copy already private (as it should be)?

ObjectSpace.each_object(Class).reject {|k| k.private_method_defined?(:initialize_copy)}
 # => [BasicObject]

Also available in: Atom PDF