我意识到这可能是我对perl或Moose的某些部分的基本误解,但我似乎无法从默认方法返回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
我该如何解决这个问题?