Skip Menu |

This queue is for tickets about the MooX-Struct CPAN distribution.

Report information
The Basics
Id: 84278
Status: resolved
Priority: 0/
Queue: MooX-Struct

People
Owner: perl [...] toby.ink
Requestors: cpan [...] prather.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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. :/
say Foo->new->isa(Foo) ? 'yes' : 'no'; # prints "yes"
CC: cpan [...] prather.org
Subject: Re: [rt.cpan.org #84278] ISA doesn't work as expected.
Date: Fri, 29 Mar 2013 17:26:12 -0400
To: bug-MooX-Struct [...] rt.cpan.org
From: Chris Prather <chris [...] prather.org>
On Fri, Mar 29, 2013 at 5:25 PM, Toby Inkster via RT <bug-MooX-Struct@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=84278 > > > say Foo->new->isa(Foo) ? 'yes' : 'no'; # prints "yes" >
Mind if I write a doc patch for this (and for the Throwable::Factory bug I reported) to make it more clear what is going on? -Chris
Show quoted text
> Mind if I write a doc patch for this (and for the Throwable::Factory > bug I reported) to make it more clear what is going on?
Please do.
Documented in 0.011