require './test.pl';
}
-plan tests => 37;
+plan tests => 39;
$SIG{__WARN__} = sub { die @_ };
eval 'my ($x,$y) : plugh;';
like $@, qr/^Invalid SCALAR attribute: ["']?plugh["']? at/;
+# bug #16080
+eval '{my $x : plugh}';
+like $@, qr/^Invalid SCALAR attribute: ["']?plugh["']? at/;
+eval '{my ($x,$y) : plugh(})}';
+like $@, qr/^Invalid SCALAR attribute: ["']?plugh\(}\)["']? at/;
+
sub A::MODIFY_SCALAR_ATTRIBUTES { return }
eval 'my A $x : plugh;';
like $@, qr/^SCALAR package attribute may clash with future reserved word: ["']?plugh["']? at/;
break; /* require real whitespace or :'s */
}
tmp = (PL_expect == XOPERATOR ? '=' : '{'); /*'}(' for vi */
- if (*s != ';' && *s != tmp && (tmp != '=' || *s != ')')) {
+ if (*s != ';' && *s != '}' && *s != tmp && (tmp != '=' || *s != ')')) {
char q = ((*s == '\'') ? '"' : '\'');
/* If here for an expression, and parsed no attrs, back off. */
if (tmp == '=' && !attrs) {