projects
/
gitmo/Moose.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
added check for an even number of options to 'has'
[gitmo/Moose.git]
/
lib
/
Moose.pm
diff --git
a/lib/Moose.pm
b/lib/Moose.pm
index
e5880c2
..
40fc9e2
100644
(file)
--- a/
lib/Moose.pm
+++ b/
lib/Moose.pm
@@
-67,7
+67,7
@@
sub has {
my $name = shift;
Moose->throw_error('Usage: has \'name\' => ( key => value, ... )')
- if @_ == 1;
+ if @_ % 2 == 1;
my %options = ( definition_context => _caller_info(), @_ );
my $attrs = ( ref($name) eq 'ARRAY' ) ? $name : [ ($name) ];