package Funky::Rectangle; use Moose; use Types::Standard qw(InstanceOf Str); use Data::Dump 'pp'; my $vertex_type = InstanceOf->of('Funky::Vertex')->plus_constructors(Str, "new"); has 'LL' => (is=>'rw', isa=>$vertex_type, coerce=>1); has 'UR' => (is=>'rw', isa=>$vertex_type, coerce=>1); # ...