X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=67caa15a4453f5072a1a4eada1c22800767c0542;hb=6e5505d4891660b3ec52547ca1915bb84f23af57;hp=066339c96ed8e6b2eb44098ede1ea330332b3393;hpb=8484866421e8caa420e118848629c3b62d6086c3;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 066339c..67caa15 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -3,7 +3,6 @@ package Catalyst; use Moose; extends 'Catalyst::Component'; use Moose::Util qw/find_meta/; -use Moose::Util::MetaRole (); use bytes; use Scope::Upper (); use Catalyst::Exception; @@ -1102,6 +1101,12 @@ EOF # applying modifiers). Scope::Upper::reap(sub { my $meta = Class::MOP::get_metaclass_by_name($class); + if ( $meta->is_immutable && ! { $meta->immutable_options }->{inline_constructor} ) { + die "You made your application class ($class) immutable, " + . "but did not inline the constructor.\n" + . "This will break catalyst, please pass " + . "(replace_constructor => 1) when making your class immutable.\n"; + } $meta->make_immutable(replace_constructor => 1) unless $meta->is_immutable; }, Scope::Upper::SCOPE(1)); @@ -2169,7 +2174,6 @@ sub setup_components { sub _controller_init_base_classes { my ($app_class, $component) = @_; foreach my $class ( reverse @{ mro::get_linear_isa($component) } ) { - next unless $class =~ /^$app_class/; Moose->init_meta( for_class => $class ) unless find_meta($class); }