summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2009-06-25 10:44:35 -0500
committerJesse Luehrs <doy@tozt.net>2009-06-25 10:44:35 -0500
commit2517c3dafb866a27d467ca5d9e4eb101c95bb106 (patch)
tree035ea2d34674017bcce50c51a14a063dd99faeb7 /lib
parent610cfb5add8b1a0dc704a983fc50135eea1a748b (diff)
downloadmoosex-nonmoose-2517c3dafb866a27d467ca5d9e4eb101c95bb106.tar.gz
moosex-nonmoose-2517c3dafb866a27d467ca5d9e4eb101c95bb106.zip
use the metainstance api rather than writing inlining myself
Diffstat (limited to 'lib')
-rw-r--r--lib/MooseX/NonMoose/Meta/Role/Constructor.pm7
1 files changed, 2 insertions, 5 deletions
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;