proto++;
arg++;
if (o2->op_type != OP_REFGEN && o2->op_type != OP_UNDEF)
- bad_type(arg, "block", gv_ename(namegv), o2);
+ bad_type(arg,
+ arg == 1 ? "block or sub {}" : "sub {}",
+ gv_ename(namegv), o2);
break;
case '*':
/* '*' allows any scalar type, including bareword */
bad_type(arg, "symbol", gv_ename(namegv), o2);
goto wrapref;
case '&':
- if (o2->op_type != OP_RV2CV)
- bad_type(arg, "sub", gv_ename(namegv), o2);
+ if (o2->op_type != OP_ENTERSUB)
+ bad_type(arg, "subroutine entry", gv_ename(namegv), o2);
goto wrapref;
case '$':
if (o2->op_type != OP_RV2SV
use strict;
-print "1..107\n";
+print "1..110\n";
my $i = 1;
##
##
+testing \&a_subx, '\&';
+
+sub a_subx (\&) {
+ print "# \@_ = (",join(",",@_),")\n";
+ &{$_[0]};
+}
+
+sub tmp_sub_2 { printf "ok %d\n",$i++ }
+a_subx &tmp_sub_2;
+
+@array = ( \&tmp_sub_2 );
+eval 'a_subx @array';
+print "not " unless $@;
+printf "ok %d\n",$i++;
+
+##
+##
+##
+
testing \&sub_aref, '&\@';
sub sub_aref (&\@) {