@@ -58,6 +58,10 @@ module.exports = function defineGrammar(dialect) {
58
58
[ $ . decorator_call_expression , $ . decorator ] ,
59
59
[ $ . literal_type , $ . pattern ] ,
60
60
[ $ . predefined_type , $ . pattern ] ,
61
+ [ $ . _primary_type , $ . _type_query_subscript_expression ] ,
62
+ [ $ . nested_type_identifier , $ . _type_query_member_expression ] ,
63
+ [ $ . nested_identifier , $ . _type_query_member_expression ] ,
64
+ [ $ . generic_type , $ . _type_query_instantiation_expression ] ,
61
65
] ) ,
62
66
63
67
conflicts : ( $ , previous ) => previous . concat ( [
@@ -618,7 +622,16 @@ module.exports = function defineGrammar(dialect) {
618
622
omitting_type_annotation : $ => seq ( '-?:' , $ . _type ) ,
619
623
adding_type_annotation : $ => seq ( '+?:' , $ . _type ) ,
620
624
opting_type_annotation : $ => seq ( '?:' , $ . _type ) ,
621
- type_annotation : $ => seq ( ':' , $ . _type ) ,
625
+ type_annotation : $ => seq (
626
+ ':' ,
627
+ choice (
628
+ $ . _type ,
629
+ alias ( $ . _type_query_subscript_expression , $ . subscript_expression ) ,
630
+ alias ( $ . _type_query_member_expression , $ . member_expression ) ,
631
+ alias ( $ . _type_query_call_expression , $ . call_expression ) ,
632
+ alias ( $ . _type_query_instantiation_expression , $ . instantiation_expression ) ,
633
+ )
634
+ ) ,
622
635
623
636
asserts : $ => seq (
624
637
'asserts' ,
0 commit comments