X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst.pm;h=67caa15a4453f5072a1a4eada1c22800767c0542;hp=28a2baa7905b8d8223d8ff810edc557af066c6d0;hb=6e5505d4891660b3ec52547ca1915bb84f23af57;hpb=5d06547d51fe24fbaeea02047325ed4ef6dc4459 diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 28a2baa..67caa15 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -1101,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));