File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -257,7 +257,12 @@ module.exports = grammar({
257257
258258 type_parameters : $ => seq (
259259 '<' ,
260- commaSep1t ( $ . type_identifier ) ,
260+ commaSep1t (
261+ seq (
262+ optional ( choice ( '+' , '-' ) ) ,
263+ $ . type_identifier
264+ )
265+ ) ,
261266 '>' ,
262267 ) ,
263268
Original file line number Diff line number Diff line change @@ -417,3 +417,20 @@ type test = (. ~attr: string) => unit
417417 (type_annotation
418418 (type_identifier)))))
419419 (unit_type))))
420+
421+ ===========================================
422+ Variance annotations
423+ ===========================================
424+
425+ type t<+'a>
426+ type t<-'a>
427+
428+ ---
429+
430+ (source_file
431+ (type_declaration
432+ (type_identifier)
433+ (type_parameters (type_identifier)))
434+ (type_declaration
435+ (type_identifier)
436+ (type_parameters (type_identifier))))
You can’t perform that action at this time.
0 commit comments