X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FAttribute.pm;h=4387bcd4616961b923edfb1c26265171dc753e32;hb=abfdffe0146e788b3b808398fb075231163c3948;hp=dec1300d931b1c739fd73de911ed1fc9bf729bcd;hpb=47cd3181d0a6edc36da5a6dc281cce4fc77c23dc;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Attribute.pm b/lib/Mouse/Meta/Attribute.pm index dec1300..4387bcd 100644 --- a/lib/Mouse/Meta/Attribute.pm +++ b/lib/Mouse/Meta/Attribute.pm @@ -75,7 +75,7 @@ sub generate_accessor { my $accessor = "sub {\n"; if ($attribute->_is_metadata eq 'rw') { - $accessor .= 'if (exists $_[1]) {' . "\n"; + $accessor .= 'if (@_ >= 2) {' . "\n"; my $value = '$_[1]'; @@ -204,6 +204,9 @@ sub create { if exists $args{coerce}; if (exists $args{isa}) { + confess "Mouse does not yet support parameterized types (rt.cpan.org #39795)" + if $args{isa} =~ /\[.*\]/; + my $type_constraint = delete $args{isa}; $type_constraint =~ s/\s//g; my @type_constraints = split /\|/, $type_constraint;