Commit | Line | Data |
58630bf0 |
1 | #!/usr/bin/perl |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
6 | use Test::More 'no_plan'; |
7 | |
af45f9d0 |
8 | # if make_immutable is removed from the following code the tests pass |
9 | |
58630bf0 |
10 | { |
11 | package Foo; |
12 | use Moose; |
13 | |
14 | has foo => ( is => "ro" ); |
15 | |
16 | __PACKAGE__->meta->make_immutable; |
17 | |
18 | package Bar; |
19 | use Moose; |
20 | |
21 | extends qw(Foo); |
22 | |
23 | around new => sub { |
24 | my $next = shift; |
25 | my ( $self, @args ) = @_; |
26 | $self->$next( foo => 42 ); |
27 | }; |
28 | |
29 | __PACKAGE__->meta->make_immutable; |
30 | |
31 | package Gorch; |
32 | use Moose; |
33 | |
34 | extends qw(Bar); |
35 | |
36 | __PACKAGE__->meta->make_immutable; |
37 | } |
38 | |
39 | is( Gorch->new->foo, 42, "around new called" ); |