summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2017-06-19 14:59:53 +1000
committerSteve Hay <steve.m.hay@googlemail.com>2017-08-23 21:22:49 +0100
commite902bd916982f3a7e98657bd98cad4276909277e (patch)
treedebde9b4c88aeeb096f5a57520c7761b56af7e62 /t
parent26f130dde1a67b60888da9266a596c990d9b0386 (diff)
downloadperl-e902bd916982f3a7e98657bd98cad4276909277e.tar.gz
(perl #131597) ensure the GV slot is filled for our [%$@]foo: attr
(cherry picked from commit 6091bd4ca4a4a4c9b6f8cadddb53c19b96748a04)
Diffstat (limited to 't')
-rw-r--r--t/op/attrs.t18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/op/attrs.t b/t/op/attrs.t
index c3cf439f1f..83f3725cc9 100644
--- a/t/op/attrs.t
+++ b/t/op/attrs.t
@@ -490,4 +490,22 @@ EOP
is($out, '', 'RT #3605: $a ? my $var : my $othervar is perfectly valid syntax');
}
+fresh_perl_is('sub dummy {} our $dummy : Dummy', <<EOS, {},
+Invalid SCALAR attribute: Dummy at - line 1.
+BEGIN failed--compilation aborted at - line 1.
+EOS
+ "attribute on our scalar with sub of same name");
+
+fresh_perl_is('sub dummy {} our @dummy : Dummy', <<EOS, {},
+Invalid ARRAY attribute: Dummy at - line 1.
+BEGIN failed--compilation aborted at - line 1.
+EOS
+ "attribute on our array with sub of same name");
+
+fresh_perl_is('sub dummy {} our %dummy : Dummy', <<EOS, {},
+Invalid HASH attribute: Dummy at - line 1.
+BEGIN failed--compilation aborted at - line 1.
+EOS
+ "attribute on our hash with sub of same name");
+
done_testing();