From: Yuval Kogman Date: Fri, 4 Jan 2008 11:40:12 +0000 (+0000) Subject: Merge 'trunk' into 'Moose-moosex_compile_support' X-Git-Tag: 0_35~19^2~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=84b56df2d53b1735aa20cac925233700f03fb129;p=gitmo%2FMoose.git Merge 'trunk' into 'Moose-moosex_compile_support' r67559@syeeda (orig r3210): stevan | 2007-12-21 21:05:51 +0200 some doc tweaks r67736@syeeda (orig r3216): stevan | 2007-12-24 18:14:13 +0200 foo r67737@syeeda (orig r3217): sartak | 2007-12-29 00:49:17 +0200 r49745@onn: sartak | 2007-12-28 17:45:06 -0500 Add failing! tests to ArrayRef[Int] + auto_deref r67738@syeeda (orig r3218): sartak | 2007-12-29 00:49:52 +0200 r49747@onn: sartak | 2007-12-28 17:49:28 -0500 A few comments in Moose::Meta::TypeConstraint::Parameterized for Penfold :) r67739@syeeda (orig r3219): nothingmuch | 2007-12-29 08:35:01 +0200 role overriding test r67740@syeeda (orig r3220): nothingmuch | 2007-12-29 18:02:02 +0200 minor doc fix r67742@syeeda (orig r3222): stevan | 2007-12-30 20:01:59 +0200 refactor in progress, beware (still passing all my tests though :P) r67743@syeeda (orig r3223): stevan | 2007-12-30 22:16:01 +0200 composition and the role model are now decoupled r67744@syeeda (orig r3224): stevan | 2007-12-30 23:51:48 +0200 fixing sartaks bug r67748@syeeda (orig r3228): stevan | 2007-12-31 18:19:56 +0200 moving stuff around and some cleanup r67749@syeeda (orig r3229): stevan | 2007-12-31 18:47:48 +0200 updating copyright dates r67751@syeeda (orig r3231): stevan | 2007-12-31 22:46:38 +0200 cleaning up and working on the spec a bit r68554@syeeda (orig r3234): stevan | 2008-01-01 22:28:05 +0200 adding method exclusion r68555@syeeda (orig r3235): stevan | 2008-01-03 08:34:31 +0200 adding in method aliasing during composition r68556@syeeda (orig r3236): stevan | 2008-01-03 09:08:08 +0200 aliasing stuff r68557@syeeda (orig r3237): stevan | 2008-01-03 09:25:17 +0200 using a little less overload stuff --- 84b56df2d53b1735aa20cac925233700f03fb129 diff --cc lib/Moose/Meta/Method/Accessor.pm index 6d50849,b669fc7..22a3eba --- a/lib/Moose/Meta/Method/Accessor.pm +++ b/lib/Moose/Meta/Method/Accessor.pm @@@ -22,12 -22,9 +22,12 @@@ sub generate_accessor_method_inline my $slot_access = $self->_inline_access($inv, $attr_name); my $value_name = $self->_value_needs_copy ? '$val' : '$_[1]'; + my $type_constraint_obj = $attr->type_constraint; + my $type_constraint_name = $type_constraint_obj && $type_constraint_obj->name; + my $code = 'sub { ' . "\n" . $self->_inline_pre_body(@_) . "\n" - . 'if (scalar(@_) == 2) {' . "\n" + . 'if (scalar(@_) >= 2) {' . "\n" . $self->_inline_copy_value . "\n" . $self->_inline_check_required . "\n" . $self->_inline_check_coercion . "\n" @@@ -43,13 -40,10 +43,14 @@@ # NOTE: # set up the environment my $type_constraint = $attr->type_constraint - ? $attr->type_constraint->_compiled_type_constraint + ? ( + $attr->type_constraint->has_hand_optimized_type_constraint + ? $attr->type_constraint->hand_optimized_type_constraint + : $attr->type_constraint->_compiled_type_constraint + ) : undef; + #warn $code; my $sub = eval $code; confess "Could not create accessor for '$attr_name' because $@ \n code: $code" if $@; return $sub;