rescript-lang / tree-sitter-rescript

ReScript parser for Tree-Sitter
MIT License
50 stars 15 forks source link

Bug: aliased type #209

Closed aspeddro closed 1 year ago

aspeddro commented 1 year ago
@obj external opt_make: (~length: int, ~width: int=?) => (_ as 'event) = ""

let test_as: ('a => 'a, _ as 'b) => 'b = List.map
(source_file [0, 0] - [2, 0]
  (decorated [0, 0] - [0, 75]
    (decorator [0, 0] - [0, 4]
      (decorator_identifier [0, 1] - [0, 4]))
    (external_declaration [0, 5] - [0, 75]
      (value_identifier [0, 14] - [0, 22])
      (type_annotation [0, 22] - [0, 70]
        (function_type [0, 24] - [0, 70]
          (function_type_parameters [0, 24] - [0, 53]
            (parameter [0, 25] - [0, 37]
              (labeled_parameter [0, 25] - [0, 37]
                (value_identifier [0, 26] - [0, 32])
                (type_annotation [0, 32] - [0, 37]
                  (type_identifier [0, 34] - [0, 37]))))
            (parameter [0, 39] - [0, 52]
              (labeled_parameter [0, 39] - [0, 52]
                (value_identifier [0, 40] - [0, 45])
                (type_annotation [0, 45] - [0, 50]
                  (type_identifier [0, 47] - [0, 50])))))
          (unit [0, 57] - [0, 70]
            (ERROR [0, 58] - [0, 69]
              (type_identifier [0, 58] - [0, 59])
              (type_identifier [0, 60] - [0, 62])
              (type_identifier [0, 63] - [0, 69])))))
      (string [0, 73] - [0, 75])))
  (let_declaration [1, 0] - [1, 49]
    (let_binding [1, 4] - [1, 49]
      pattern: (value_identifier [1, 4] - [1, 11])
      (type_annotation [1, 11] - [1, 38]
        (function_type [1, 13] - [1, 38]
          (function_type_parameters [1, 13] - [1, 32]
            (tuple_type [1, 13] - [1, 32]
              (function_type [1, 14] - [1, 22]
                (function_type_parameters [1, 14] - [1, 16]
                  (type_identifier [1, 14] - [1, 16]))
                (type_identifier [1, 20] - [1, 22]))
              (ERROR [1, 24] - [1, 31]
                (type_identifier [1, 24] - [1, 25])
                (type_identifier [1, 26] - [1, 28])
                (type_identifier [1, 29] - [1, 31]))))
          (type_identifier [1, 36] - [1, 38])))
      body: (value_identifier_path [1, 41] - [1, 49]
        (module_identifier [1, 41] - [1, 45])
        (value_identifier [1, 46] - [1, 49])))))