4
我知道这可能是我的一部分Perl或驼鹿的某些部分的基本误解,但我似乎不能够从一个default
方法返回一个数组引用:MooseX ::声明如何从属性默认方法返回ArrayRef?
has '_directories' => (
is => 'ro',
isa => 'ArrayRef[Str]',
lazy => 1,
init_arg => undef,
default => method {return File::Spec->splitdir($self->relativeDirectory)});
给出:
Attribute (_directories) does not pass the type constraint because:
Validation failed for 'ArrayRef[Str]' with value 3
我该如何分拣出来?