Skip to content

Commit ef003b2

Browse files
committed
fix: annotations parsing order for spread parameters
1 parent a7db522 commit ef003b2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

grammar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1240,8 +1240,8 @@ module.exports = grammar({
12401240
spread_parameter: $ => seq(
12411241
optional($.modifiers),
12421242
$._unannotated_type,
1243-
'...',
12441243
repeat($._annotation),
1244+
'...',
12451245
$.variable_declarator,
12461246
),
12471247

test/corpus/expressions.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1934,7 +1934,7 @@ for (int i = 0, _ = sideEffect(); i < 10; i++) { }
19341934
Annotations before a spread parameter's ellipsis
19351935
================================================================================
19361936

1937-
void foo(int... @Foo x) {
1937+
void foo(int @Foo ... x) {
19381938
}
19391939

19401940
---

0 commit comments

Comments
 (0)