my $seen = $self->{brd_seen};
my $body;
- if (!$self->{brd_sub} or !$self->_recurse or $seen->{$name} or !$$cv) {
+ if (!$self->{brd_sub} or !$self->_recurse or $seen->{$name} or !$$cv
+ or !$cv->isa('B::CV') or $cv->ROOT->isa('B::NULL')) {
$body = $self->SUPER::pp_gv(@_);
} else {
$body = do {
use strict;
use warnings;
-use Test::More tests => 2 * 4 * 6;
+use Test::More tests => 2 * 4 * 7;
use B::RecDeparse;
my $brd = B::RecDeparse->new(level => -1);
sub foo { 123 }
+sub baz;
my $pkg;
my $coderef;
[ x3 => 'bar(@_)', 'bar' ],
[ x4 => 'bar(shift)', 'bar' ],
+ [ d1 => 'baz()', 'baz' ],
+ [ d2 => 'baz(1)', 'baz' ],
+ [ d3 => 'baz(@_)', 'baz' ],
+ [ d4 => 'baz(shift)', 'baz' ],
+
[ c1 => '$coderef->()', 'coderef' ],
[ c2 => '$coderef->(1)', 'coderef' ],
[ c3 => '$coderef->(@_)', 'coderef' ],