Re: union isn't finding the types

[email protected] (Jesse Luehrs)
Newsgroups perl.moose
Message-ID <[email protected]>
On Mon, Feb 18, 2013 at 08:35:16PM -0800, Ben Tilly wrote:
> This is documented, sort of.
> 
> http://search.cpan.org/dist/Moose/lib/Moose/Manual/Types.pod#WHAT_IS_A_TYPE?
> 
> Any Moose type is automatically a type.  Any created type is a type.
> Any reference to something unknown is assumed to be a type.  But the
> magic breaks down when you've got complex expressions, pieces of which
> are non-Moose classes.
> 
> So add in:
> 
> subtype 'Log::Any::Adaptor::Base', as 'Object', where
> {$_->isa('Log::Any::Adaptor::Base')};
> subtype 'Log::Any::Adapter::Null', as 'Object', where
> {$_->isa('Log::Any::Adapter::Null')};
> 
> and it should work.

A shorter way to write that is "class_type('Log::Any::Adaptor::Base')".

-doy
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.