Skip to content

Commit 33a3868

Browse files
committed
fix: allow annotations after the ellipsis in a spread parameter
1 parent e75fda2 commit 33a3868

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

grammar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,6 +1241,7 @@ module.exports = grammar({
12411241
optional($.modifiers),
12421242
$._unannotated_type,
12431243
'...',
1244+
repeat($._annotation),
12441245
$.variable_declarator,
12451246
),
12461247

test/corpus/expressions.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1925,3 +1925,25 @@ for (int i = 0, _ = sideEffect(); i < 10; i++) { }
19251925
(update_expression
19261926
(identifier))
19271927
(block)))
1928+
1929+
================================================================================
1930+
Annotations before a spread parameter's ellipsis
1931+
================================================================================
1932+
1933+
void foo(int... @Foo x) {
1934+
}
1935+
1936+
---
1937+
1938+
(program
1939+
(method_declaration
1940+
(void_type)
1941+
(identifier)
1942+
(formal_parameters
1943+
(spread_parameter
1944+
(integral_type)
1945+
(marker_annotation
1946+
(identifier))
1947+
(variable_declarator
1948+
(identifier))))
1949+
(block)))

0 commit comments

Comments
 (0)