From: Rafael Garcia-Suarez <rgarciasuarez@gmail.com>
Date: Mon, 20 Nov 2006 18:03:43 +0000 (+0000)
Subject: Unify the two warnings "Can't declare %s in %s", in line with what's
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fab01b8e4080035d4784d26a98f32ff7082031b0;p=p5sagit%2Fp5-mst-13.2.git

Unify the two warnings "Can't declare %s in %s", in line with what's
documented in perldiag.

p4raw-id: //depot/perl@29330
---

diff --git a/op.c b/op.c
index 32bf1d8..20948c7 100644
--- a/op.c
+++ b/op.c
@@ -1778,7 +1778,7 @@ S_my_kid(pTHX_ OP *o, OP *attrs, OP **imopsp)
 	       type == OP_RV2AV ||
 	       type == OP_RV2HV) { /* XXX does this let anything illegal in? */
 	if (cUNOPo->op_first->op_type != OP_GV) { /* MJD 20011224 */
-	    yyerror(Perl_form(aTHX_ "Can't declare %s in %s",
+	    yyerror(Perl_form(aTHX_ "Can't declare %s in \"%s\"",
 			OP_DESC(o),
 			PL_in_my == KEY_our ? "our" : PL_in_my == KEY_state ? "state" : "my"));
 	} else if (attrs) {
diff --git a/t/op/attrs.t b/t/op/attrs.t
index abfdb2c..7b20210 100644
--- a/t/op/attrs.t
+++ b/t/op/attrs.t
@@ -153,9 +153,9 @@ eval_ok '
 
 # bug #15898
 eval 'our ${""} : foo = 1';
-like $@, qr/Can't declare scalar dereference in our/;
+like $@, qr/Can't declare scalar dereference in "our"/;
 eval 'my $$foo : bar = 1';
-like $@, qr/Can't declare scalar dereference in my/;
+like $@, qr/Can't declare scalar dereference in "my"/;
 
 
 my @code = qw(lvalue locked method);