summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-12-16 09:25:30 -0800
committerFather Chrysostomos <sprout@cpan.org>2011-12-16 09:54:17 -0800
commitfc7debfb01ac69b2164761b2dce72408a865197e (patch)
treef06ba7b49ab86cb117d743f5e06b934cba5de9df /pp_ctl.c
parentf4912a505dea4e7cb15f15e044af09ad225528df (diff)
downloadperl-fc7debfb01ac69b2164761b2dce72408a865197e.tar.gz
[perl #91514] Use correct error msg for default
This commit not only mentions default (as opposed to when) in the error message about it being outside a topicalizer, but also normalises those error messages, making them consistent with continue and other loop controls. It also makes the perldiag entry for when actually match the error message.
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 953a749948..a9012ee57f 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -5024,7 +5024,9 @@ PP(pp_leavewhen)
cxix = dopoptogiven(cxstack_ix);
if (cxix < 0)
- DIE(aTHX_ "Can't use when() outside a topicalizer");
+ /* diag_listed_as: Can't "when" outside a topicalizer */
+ DIE(aTHX_ "Can't \"%s\" outside a topicalizer",
+ PL_op->op_flags & OPf_SPECIAL ? "default" : "when");
POPBLOCK(cx,newpm);
assert(CxTYPE(cx) == CXt_WHEN);