Subject: | ISA doesn't work as expected. |
I reported this via phenny but I thought I'd make this official since it's the root cause of the other bug in Throwable::Factory I just reported.
While "all the standard Perl (isa, can, etc) and Moo (new, does, etc) methods are available." some of them are more useful than others. Specifically isa() doesn't report anything useful and fails for the obvious case:
use MooseX::Struct
Foo => undef
;
say Foo->new->isa('Foo') ? 'yes' : 'no'; # prints "no"
The solution is simply if redundant.
use MooseX::Struct
Foo => [-class => ['Foo']]
;
say Foo->new->isa('Foo') ? 'yes' : 'no'; # now prints "yes"
I'm not sure what the right answer here, but I really am sure that the half day I spent figuring this out wasn't it. :/