alex-pinkus / tree-sitter-swift

A tree-sitter grammar for the Swift programming language.
MIT License
137 stars 35 forks source link

Generic types are recognized as `comparison_expression` #396

Open wojciech-kulik opened 5 months ago

wojciech-kulik commented 5 months ago

Example:

provider.request(
    type: Response<MyDataStructure>.self,
    service: MyService.someEndpoint
) { (response: SomeResponse) in
   // code
}

Result:

(call_expression ; [40, 8] - [45, 9]
  (navigation_expression ; [40, 8] - [40, 24]
    target: (simple_identifier) ; [40, 8] - [40, 16]
    suffix: (navigation_suffix ; [40, 16] - [40, 24]
      suffix: (simple_identifier))) ; [40, 17] - [40, 24]
  (call_suffix ; [40, 24] - [45, 9]
    (value_arguments ; [40, 24] - [43, 9]
      (value_argument ; [41, 12] - [41, 48]
        name: (value_argument_label ; [41, 12] - [41, 16]
          (simple_identifier)) ; [41, 12] - [41, 16]
        value: (comparison_expression ; [41, 18] - [41, 48]
          lhs: (simple_identifier) ; [41, 18] - [41, 26]
          rhs: (comparison_expression ; [41, 27] - [41, 48]
            lhs: (simple_identifier) ; [41, 27] - [41, 42]
            rhs: (prefix_expression ; [41, 43] - [41, 48]
              target: (self_expression))))) ; [41, 44] - [41, 48]
  ...
alex-pinkus commented 5 months ago

Thanks for the report! I think this is the same as #350