- fixed some details in Moose::init_meta
and its superclass handling (thanks thepler)
- added tests for this (thanks thepler)
+ - 'has' now dies if you don't pass in name
+ value pairs
* Moose::Meta::Class
Moose::Meta::Method::Constructor
has => sub {
my $class = $CALLER;
return subname 'Moose::has' => sub ($;%) {
- my ( $name, %options ) = @_;
+ my $name = shift;
+ die 'Usage: has \'name\' => ( key => value, ... )' if @_ == 1;
+ my %options = @_;
my $attrs = ( ref($name) eq 'ARRAY' ) ? $name : [ ($name) ];
$class->meta->add_attribute( $_, %options ) for @$attrs;
};