We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e79b820 commit 0e943ceCopy full SHA for 0e943ce
t/op/defer.t
@@ -6,7 +6,7 @@ BEGIN {
6
set_up_inc('../lib');
7
}
8
9
-plan 32;
+plan 33;
10
11
use feature 'defer';
12
no warnings 'experimental::defer';
@@ -325,3 +325,22 @@ no warnings 'experimental::defer';
325
"Got expected exception: last out of defer block");
326
327
328
+# [GH #23964]
329
+{
330
+ use warnings;
331
+ no warnings 'experimental::defer';
332
+ use feature 'say';
333
+
334
+ eval {
335
+ sub f { goto FOO; }
336
+ sub g { defer { f() } }
337
+ g();
338
+ goto BAR;
339
+ FOO: say "FOO";
340
+ BAR: say "BAR";
341
+ };
342
+ like($@,
343
+ qr/Can't \"goto\" out of a \"defer\" block/,
344
+ "Got expected exception: can't goto out of defer block");
345
+}
346
0 commit comments