From: Stevan Little Date: Fri, 21 Sep 2007 19:44:43 +0000 (+0000) Subject: missed one bit X-Git-Tag: 0_44~12 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ad315b7596683ccd663563ac64df84e944e5a17b;p=gitmo%2FClass-MOP.git missed one bit --- diff --git a/lib/Class/MOP/Method/Constructor.pm b/lib/Class/MOP/Method/Constructor.pm index 9439beb..75e3ec2 100644 --- a/lib/Class/MOP/Method/Constructor.pm +++ b/lib/Class/MOP/Method/Constructor.pm @@ -16,14 +16,15 @@ sub new { my $class = shift; my %options = @_; - (exists $options{options} && ref $options{options} eq 'HASH') - || confess "You must pass a hash of options"; + (blessed $options{metaclass} && $options{metaclass}->isa('Class::MOP::Class')) + || confess "You must pass a metaclass instance if you want to inline" + if $options{is_inline}; my $self = bless { # from our superclass '&!body' => undef, # specific to this subclass - '%!options' => $options{options}, + '%!options' => $options{options} || {}, '$!associated_metaclass' => $options{metaclass}, '$!is_inline' => ($options{is_inline} || 0), } => $class;