Don't mix declarations and code when declaring the stack pointer.
[p5sagit/Devel-Declare.git] / lib / Devel / Declare.pm
index a315f66..a3e76bf 100644 (file)
@@ -14,6 +14,7 @@ use constant DECLARE_PACKAGE => 8+1; # name implicit
 use vars qw(%declarators %declarator_handlers @ISA);
 use base qw(DynaLoader);
 use Scalar::Util 'set_prototype';
+use B::Hooks::OP::Check;
 
 bootstrap Devel::Declare;
 
@@ -96,7 +97,6 @@ sub shadow_sub {
   no strict 'refs';
   my ($pack, $pname) = ($name =~ m/(.+)::([^:]+)/);
   push(@$temp_save, $pack->can($pname));
-  delete ${"${pack}::"}{$pname};
   no warnings 'redefine';
   no warnings 'prototype';
   *{$name} = $cr;