@@ -88,11 +88,11 @@ module.exports = grammar({
88
88
89
89
conflicts : $ => [
90
90
[ $ . _simple_type , $ . _expression ] ,
91
+ [ $ . _simple_type , $ . generic_type , $ . _expression ] ,
91
92
[ $ . qualified_type , $ . _expression ] ,
92
- [ $ . generic_type , $ . _expression ] ,
93
93
[ $ . generic_type , $ . _simple_type ] ,
94
+ [ $ . parameter_declaration , $ . _simple_type , $ . generic_type , $ . _expression ] ,
94
95
[ $ . parameter_declaration , $ . _simple_type , $ . _expression ] ,
95
- [ $ . parameter_declaration , $ . generic_type , $ . _expression ] ,
96
96
[ $ . parameter_declaration , $ . _expression ] ,
97
97
[ $ . parameter_declaration , $ . _simple_type ] ,
98
98
] ,
@@ -304,10 +304,10 @@ module.exports = grammar({
304
304
$ . negated_type ,
305
305
) ,
306
306
307
- generic_type : $ => seq (
307
+ generic_type : $ => prec . dynamic ( 1 , seq (
308
308
field ( 'type' , choice ( $ . _type_identifier , $ . qualified_type , $ . union_type , $ . negated_type ) ) ,
309
309
field ( 'type_arguments' , $ . type_arguments ) ,
310
- ) ,
310
+ ) ) ,
311
311
312
312
type_arguments : $ => prec . dynamic ( 2 , seq (
313
313
'[' ,
@@ -665,6 +665,7 @@ module.exports = grammar({
665
665
$ . call_expression ,
666
666
$ . type_assertion_expression ,
667
667
$ . type_conversion_expression ,
668
+ $ . type_instantiation_expression ,
668
669
$ . identifier ,
669
670
alias ( choice ( 'new' , 'make' ) , $ . identifier ) ,
670
671
$ . composite_literal ,
@@ -771,6 +772,14 @@ module.exports = grammar({
771
772
')' ,
772
773
) ) ,
773
774
775
+ type_instantiation_expression : $ => prec . dynamic ( - 1 , seq (
776
+ field ( 'type' , $ . _type ) ,
777
+ '[' ,
778
+ commaSep1 ( $ . _type ) ,
779
+ optional ( ',' ) ,
780
+ ']' ,
781
+ ) ) ,
782
+
774
783
composite_literal : $ => prec ( PREC . composite_literal , seq (
775
784
field ( 'type' , choice (
776
785
$ . map_type ,
0 commit comments