From: Yuval Kogman Date: Fri, 27 Jun 2008 09:42:21 +0000 (+0000) Subject: t0m's around vs. immutable bug X-Git-Tag: 0_55~82 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=58630bf027e03612e4432f0b0e29e145194f3789;p=gitmo%2FMoose.git t0m's around vs. immutable bug --- diff --git a/t/100_bugs/015_immutable_n_around.t b/t/100_bugs/015_immutable_n_around.t new file mode 100644 index 0000000..95d4202 --- /dev/null +++ b/t/100_bugs/015_immutable_n_around.t @@ -0,0 +1,37 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use Test::More 'no_plan'; + +{ + package Foo; + use Moose; + + has foo => ( is => "ro" ); + + __PACKAGE__->meta->make_immutable; + + package Bar; + use Moose; + + extends qw(Foo); + + around new => sub { + my $next = shift; + my ( $self, @args ) = @_; + $self->$next( foo => 42 ); + }; + + __PACKAGE__->meta->make_immutable; + + package Gorch; + use Moose; + + extends qw(Bar); + + __PACKAGE__->meta->make_immutable; +} + +is( Gorch->new->foo, 42, "around new called" );