}
}
+# This test file contains 57 tests.
+# You need to number them manually. Don't forget to update this line for the
+# next kind hacker.
+
END {print "not ok 1\n" unless $loaded;}
use v5.6.0;
use Attribute::Handlers;
my Test $x2 :Dokay(1,5);
+if ($] < 5.011) {
+ ::ok(1, $_, '# skip : invalid before 5.11') for 55 .. 57;
+} else {
+ my $c = $::count;
+ eval '
+ my Test @x2 :Dokay(1,55);
+ my Test %x2 :Dokay(1,56);
+ ';
+ $c = $c + 2 - $::count;
+ while ($c > 0) {
+ ::ok(0, 57 - $c);
+ --$c;
+ }
+ ::ok(!$@, 57);
+}
+
package Test;
my $x3 :Dokay(1,6);
my Test $x4 :Dokay(1,7);
/* check for duplicate declaration */
pad_check_dup(name, is_our, (PL_curstash ? PL_curstash : PL_defstash));
- if (PL_parser->in_my_stash && *name != '$') {
- yyerror(Perl_form(aTHX_
- "Can't declare class for non-scalar %s in \"%s\"",
- name,
- is_our ? "our"
- : PL_parser->in_my == KEY_state ? "state" : "my"));
- }
-
/* allocate a spare slot and store the name in that slot */
off = pad_add_name(name,
require './test.pl';
}
-plan 83;
+plan 84;
$SIG{__WARN__} = sub { die @_ };
is $@, '';
eval 'package Cat; my Cat @socks;';
-like $@, qr/^Can't declare class for non-scalar \@socks in "my"/;
+like $@, '';
+
+eval 'my Cat %nap;';
+like $@, '';
sub X::MODIFY_CODE_ATTRIBUTES { die "$_[0]" }
sub X::foo { 1 }