call warn_on_symbol_pollution in make_immutable abandoned/autoclean_reminder
Yuval Kogman [Thu, 17 Sep 2009 21:07:28 +0000 (00:07 +0300)]
lib/Class/MOP/Class.pm

index 9fd58db..95806e6 100644 (file)
@@ -932,8 +932,14 @@ sub make_immutable {
     my ( $self, @args ) = @_;
 
     if ( $self->is_mutable ) {
-        $self->_initialize_immutable( $self->_immutable_options(@args) );
+        my %options = $self->_immutable_options(@args);
+
+        $self->_initialize_immutable(%options);
         $self->_rebless_as_immutable(@args);
+
+        $self->warn_on_symbol_pollution
+            unless $options{no_pollution_check};
+
         return $self;
     }
     else {
@@ -1615,6 +1621,10 @@ generate the inlined destructor. This defaults to
 This is a boolean indicating whether an existing destructor should be
 replaced when inlining a destructor. This defaults to false.
 
+=item * no_pollution_check
+
+Suppresses the call to C<warn_on_symbol_pollution>
+
 =back
 
 =item B<< $metaclass->immutable_options >>