From: Dave Rolsky Date: Tue, 17 Mar 2009 16:00:10 +0000 (-0500) Subject: Make the generate_* methods in CMOP::Method::Constructor private X-Git-Tag: 0.80_01~31 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ecb874a000406268ea28352a2ea9efd3e15e37f2;p=gitmo%2FClass-MOP.git Make the generate_* methods in CMOP::Method::Constructor private --- diff --git a/lib/Class/MOP/Method/Constructor.pm b/lib/Class/MOP/Method/Constructor.pm index 6e8337e..3c4c637 100644 --- a/lib/Class/MOP/Method/Constructor.pm +++ b/lib/Class/MOP/Method/Constructor.pm @@ -81,7 +81,7 @@ sub initialize_body { sub _initialize_body { my $self = shift; - my $method_name = 'generate_constructor_method'; + my $method_name = '_generate_constructor_method'; $method_name .= '_inline' if $self->is_inline; @@ -89,10 +89,22 @@ sub _initialize_body { } sub generate_constructor_method { + warn 'The generate_constructor_method method has been made private.' + . " The public version is deprecated and will be removed in a future release.\n"; + goto &_generate_constructor_method; +} + +sub _generate_constructor_method { return sub { Class::MOP::Class->initialize(shift)->new_object(@_) } } sub generate_constructor_method_inline { + warn 'The generate_constructor_method_inline method has been made private.' + . " The public version is deprecated and will be removed in a future release.\n"; + goto &_generate_constructor_method_inline; +} + +sub _generate_constructor_method_inline { my $self = shift; my $close_over = {};