Hi all,

I am trying to do the following with MX::D:

use MooseX::Declare;
class fREW with BusinessCard {
   method BUILD {
      $self->job('Programmer');
      my $email = reverse 'moc.li...@xuoirf';
      $self->email($email);
   }
}

and I get the following error on instantiation:

 died: Validation failed for
'MooseX::Types::Structured::Tuple[MooseX::Types::Structured::Tuple[Object],MooseX::Types::Structured::Dict[]]'
failed with value [ [ fREW=HASH(0x83da2c0) ], { HASH(0x83ae760) => undef }
], Internal Validation Error is: Validation failed for
'MooseX::Types::Structured::Dict[]' failed with value { HASH(0x83ae760) =>
undef } at
/usr/local/share/perl/5.10.0/MooseX/Method/Signatures/Meta/Method.pm line
365
#       MooseX::Method::Signatures::Meta::Method::validate() called at
/usr/local/share/perl/5.10.0/MooseX/Method/Signatures/Meta/Method.pm line
139
#       fREW::BUILD() called at generated method (unknown origin) line 25
#       fREW::new() called at t/frew.t line 13
#       Test::Exception::lives_ok() called at t/frew.t line 13
Reference found where even-sized list expected at
/usr/local/share/perl/5.10.0/MooseX/Method/Signatures/Meta/Method.pm line
335.
Validation failed for
'MooseX::Types::Structured::Tuple[MooseX::Types::Structured::Tuple[Object],MooseX::Types::Structured::Dict[]]'
failed with value [ [ fREW=HASH(0x83e0370) ], { HASH(0x83ae880) => undef }
], Internal Validation Error is: Validation failed for
'MooseX::Types::Structured::Dict[]' failed with value { HASH(0x83ae880) =>
undef } at
/usr/local/share/perl/5.10.0/MooseX/Method/Signatures/Meta/Method.pm line
365

MooseX::Method::Signatures::Meta::Method::validate('MooseX::Method::Signatures::Meta::Method=HASH(0x9081808)',
'ARRAY(0x851baf0)') called at
/usr/local/share/perl/5.10.0/MooseX/Method/Signatures/Meta/Method.pm line
139
        fREW::BUILD('fREW=HASH(0x83e0370)', 'HASH(0x83ae880)') called at
generated method (unknown origin) line 25
        fREW::new('fREW') called at t/frew.t line 14

How do I define a BUILD with MX::D?
-- 
fREW Schmidt
http://blog.afoolishmanifesto.com

Reply via email to