projects
/
gitmo/Moose.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(parent:
43837b8
)
Enum needs to check that the value is not a ref
Dave Rolsky [Fri, 15 Apr 2011 15:36:24 +0000 (10:36 -0500)]
lib/Moose/Meta/TypeConstraint/Enum.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/Moose/Meta/TypeConstraint/Enum.pm
b/lib/Moose/Meta/TypeConstraint/Enum.pm
index
2a7beb7
..
10e7c1e
100644
(file)
--- a/
lib/Moose/Meta/TypeConstraint/Enum.pm
+++ b/
lib/Moose/Meta/TypeConstraint/Enum.pm
@@
-23,7
+23,8
@@
my $inliner = sub {
$ENUMS{$name} ||= { map { $_ => 1 } @{ $self->values() } };
return
- "defined $val && " . '$'
+ "defined $val"
+ . "&& ! ref $val" . '&& $'
. __PACKAGE__
. '::ENUMS{'
. B::perlstring($name)