summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-04-27 06:28:31 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-04-27 06:28:31 +0000
commit75fc29ea54ba4d478cc0c602155e9d1eac8964e1 (patch)
tree02be7d2293f03555db6e45dd44a44aec9b956768 /op.c
parentf74a9bd30d3c2206b2400120919ced20a68f30b0 (diff)
downloadperl-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.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/op.c b/op.c
index 95aa4f2739..711be2f6e2 100644
--- a/op.c
+++ b/op.c
@@ -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