summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2015-01-21 21:37:01 -0800
committerFather Chrysostomos <sprout@cpan.org>2015-01-21 21:38:14 -0800
commit64016071d009e8d6ad2dc5a71b86e0e2741a7037 (patch)
treec6381b327af120aaf6e762c20adde5a2fef2c9a2 /t
parentaa9621e6ae7442f957cee30769521f3030bd582f (diff)
downloadperl-64016071d009e8d6ad2dc5a71b86e0e2741a7037.tar.gz
attributes.xs: Don’t emit const warning for anons
The intent was to emit the warning for any cases other than custom attributes on anonymous subs. I did that by checking to see whether we had a closure prototype, warning otherwise. But anonymous subs that are not closures are not closure prototypes. So we need to check CvANON instead.
Diffstat (limited to 't')
-rw-r--r--t/op/attrs.t4
1 files changed, 3 insertions, 1 deletions
diff --git a/t/op/attrs.t b/t/op/attrs.t
index f8515fb3d0..b93ed74eb9 100644
--- a/t/op/attrs.t
+++ b/t/op/attrs.t
@@ -407,7 +407,9 @@ is $ProtoTest::Proto, '$', 'prototypes are visible in attr handlers';
attributes->import(shift, shift, lc shift) if $_[2]; ()
}
$_ = 32487;
- my $sub = sub : Const { $_ };
+ my $sub = eval '+sub : Const { $_ }';
+ ::is $w, '',
+ 'no warning for :const applied to closure protosub via attributes.pm';
undef $_;
::is &$sub, 32487,
'applying const attr via attributes.pm';