Bug #9138

make initialize_copy private

Added by Zachary Scott about 2 years ago. Updated almost 2 years ago.

Assignee:Zachary Scott
ruby -v:2.1.0dev Backport:1.9.3: UNKNOWN, 2.0.0: UNKNOWN


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.


#1 Updated by Zachary Scott almost 2 years ago

  • Target version set to next minor

Going to postpone this until 2.2

#2 Updated by Marc-Andre Lafortune almost 2 years 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