diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-04-27 06:28:31 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-04-27 06:28:31 +0000 |
commit | 75fc29ea54ba4d478cc0c602155e9d1eac8964e1 (patch) | |
tree | 02be7d2293f03555db6e45dd44a44aec9b956768 /op.c | |
parent | f74a9bd30d3c2206b2400120919ced20a68f30b0 (diff) | |
download | perl-75fc29ea54ba4d478cc0c602155e9d1eac8964e1.tar.gz |
patch from Larry to make (\&) prototype work; added tests for
the same
p4raw-id: //depot/perl@5963
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -6262,7 +6262,9 @@ Perl_ck_subr(pTHX_ OP *o) 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 */ @@ -6310,8 +6312,8 @@ Perl_ck_subr(pTHX_ OP *o) 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 |