Closed 2shortplanks closed 6 years ago
This is almost certainly a bug in PVC. I thought I'd squashed this sort of bug though. Are you using the most recent version of PVC?
I'm using version 0.26
, so yes. Latest version of Moose too.
Yeah, I figured. This is definitely a bug. I'll try to look into it soonish, but feel free to nag me about it next week.
Frabjous day! It's a bug in Moose, not PVC ...
package Foo;
use strict;
use warnings;
use Devel::Dwarn;
use Moose::Util::TypeConstraints;
enum 'Colors' => [qw( red green blue )];
my $type = subtype( as 'ArrayRef[Colors]' );
warn $type->_inline_check('$foo');
Dwarn $type->_inline_environment;
And that prints ...
$> perl ./foo.pl
( do { do {my $check = $foo;ref($check) eq "ARRAY" && &List::Util::all(sub { ( do { defined($_) && !ref($_) && $enums0{$_} } ) }, @{$check})} } ) at ./foo.pl line 13.
{}
So PR for Moose is welcome ;)
Actually, I take it back, it might be a bug in PVC ...
Fixed in v0.27
I'm not sure if this is a Params::ValidationCompiler issue or a moose issue, but...
Gives a horrible horrible error: