Hey all,

I've read through the Moose::Manual::Types, Moose::Util::TypeConstraints, and other things I could find. I don't quite see how I am supposed to create a property that holds "a derivative of class X". For example, I would like to do:

   package A;
   use Moose;
   1;

   package B;
   use Moose;
   extends A;
   1;

   package C;
   use Moose;
   has a => (isa=>'A', is=>'rw');
   1;

   ### Create "B" which extends "A"
   my $b = B->new();

   ### Create C with property "a" of value $b.  $b is an "A" derivative,
   ### so I'd like it to be ok with that.
   my $c = C->new(a=>$b);

Any help would be appreciated.

-Sir


Reply via email to