8 has foo => (is => 'ro');
15 has bar => (is => 'ro');
19 my $foo = Foo::Sub->new(foo => 12, bar => 25);
20 is($foo->foo, 12, 'got right value for foo');
21 is($foo->bar, 25, 'got right value for bar');
24 Foo->meta->make_immutable;
30 has baz => (is => 'ro');
31 # not making immutable, inheriting Foo's inlined constructor
35 my $foo = Foo::Sub2->new(foo => 42, baz => 27);
36 is($foo->foo, 42, 'got right value for foo');
37 is($foo->baz, 27, 'got right value for baz');
50 sub DEMOLISH { $BAR++ }
54 is($BAR, 1, 'DEMOLISH in subclass was called');
57 Bar->meta->make_immutable;
63 sub DEMOLISH { $BAR++ }
64 # not making immutable, inheriting Bar's inlined destructor
68 is($BAR, 1, 'DEMOLISH in subclass was called');