From 2517c3dafb866a27d467ca5d9e4eb101c95bb106 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 25 Jun 2009 10:44:35 -0500 Subject: use the metainstance api rather than writing inlining myself --- lib/MooseX/NonMoose/Meta/Role/Constructor.pm | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/MooseX/NonMoose/Meta/Role/Constructor.pm b/lib/MooseX/NonMoose/Meta/Role/Constructor.pm index 9733c3d..9a69d7c 100644 --- a/lib/MooseX/NonMoose/Meta/Role/Constructor.pm +++ b/lib/MooseX/NonMoose/Meta/Role/Constructor.pm @@ -58,11 +58,8 @@ sub _generate_instance { my $arglist = $meta->get_method('FOREIGNBUILDARGS') ? "${class_var}->FOREIGNBUILDARGS(\@_)" : '@_'; - # XXX: this should probably be taking something from the meta-instance api, - # rather than calling bless directly, but this works fine for now, and i - # want to wait for the whole immutablization stuff to settle down before - # digging too deeply into it - "my $var = bless $super_new_class->$new($arglist), $class_var;\n"; + my $instance = "$super_new_class->$new($arglist)"; + "my $var = " . $self->_meta_instance->inline_rebless_instance_structure($instance, $class_var) . ";\n"; } no Moose::Role; -- cgit v1.2.3-54-g00ecf