diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/threads/t/problems.t | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/ext/threads/t/problems.t b/ext/threads/t/problems.t index d555dcdc24..f4688134e5 100644 --- a/ext/threads/t/problems.t +++ b/ext/threads/t/problems.t @@ -18,7 +18,7 @@ use threads::shared; # call is() from within the DESTROY() function at global destruction time, # and parts of Test::* may have already been freed by then -print "1..8\n"; +print "1..10\n"; my $test : shared = 1; @@ -93,6 +93,17 @@ threads->new( } )->join; +# bugid #24940 :unique should fail on my and sub declarations + +for my $decl ('my $x : unique', 'sub foo : unique') { + eval $decl; + print $@ =~ + /^The 'unique' attribute may only be applied to 'our' variables/ + ? '' : 'not ', "ok $test - $decl\n"; + $test++; +} + + # Returing a closure from a thread caused problems. If the last index in # the anon sub's pad wasn't for a lexical, then a core dump could occur. # Otherwise, there might be leaked scalars. |