12 use Moose::Util::TypeConstraints;
14 coerce 'Baz' => from 'HashRef' => via { Baz->new($_) };
23 use Moose::Util::TypeConstraints;
25 coerce 'Bar' => from 'HashRef' => via { Bar->new($_) };
43 my $foo = Foo->new(bar => { baz => { hello => 'World' } });
45 isa_ok($foo->bar, 'Bar');
46 isa_ok($foo->bar->baz, 'Baz');
47 is($foo->bar->baz->hello, 'World', '... this all worked fine');