Skip to content

Error: Functor #222

Closed
Closed
@aspeddro

Description

@aspeddro
module F2: (S1, S1) => T = (X: S, Y: S) => {
  let cow = x => Y.foo(X.foo(x))
  let sheep = x => 1 + cow(x)
}
(source_file [0, 0] - [4, 0]
  (module_declaration [0, 0] - [3, 1]
    (module_binding [0, 7] - [3, 1]
      name: (module_identifier [0, 7] - [0, 9])
      signature: (parenthesized_module_expression [0, 11] - [0, 19]
        (module_identifier [0, 12] - [0, 14])
        (ERROR [0, 14] - [0, 18]))
      (ERROR [0, 20] - [0, 24])
      definition: (functor [0, 27] - [3, 1]
        parameters: (functor_parameters [0, 27] - [0, 39]
          (functor_parameter [0, 28] - [0, 32]
            (module_identifier [0, 28] - [0, 29])
            (module_type_annotation [0, 29] - [0, 32]
              (module_identifier [0, 31] - [0, 32])))
          (functor_parameter [0, 34] - [0, 38]
            (module_identifier [0, 34] - [0, 35])
            (module_type_annotation [0, 35] - [0, 38]
              (module_identifier [0, 37] - [0, 38]))))
        body: (block [0, 43] - [3, 1]
          (let_declaration [1, 2] - [1, 32]
            (let_binding [1, 6] - [1, 32]
              pattern: (value_identifier [1, 6] - [1, 9])
              body: (function [1, 12] - [1, 32]
                parameter: (value_identifier [1, 12] - [1, 13])
                body: (call_expression [1, 17] - [1, 32]
                  function: (value_identifier_path [1, 17] - [1, 22]
                    (module_identifier [1, 17] - [1, 18])
                    (value_identifier [1, 19] - [1, 22]))
                  arguments: (arguments [1, 22] - [1, 32]
                    (call_expression [1, 23] - [1, 31]
                      function: (value_identifier_path [1, 23] - [1, 28]
                        (module_identifier [1, 23] - [1, 24])
                        (value_identifier [1, 25] - [1, 28]))
                      arguments: (arguments [1, 28] - [1, 31]
                        (value_identifier [1, 29] - [1, 30]))))))))
          (let_declaration [2, 2] - [2, 29]
            (let_binding [2, 6] - [2, 29]
              pattern: (value_identifier [2, 6] - [2, 11])
              body: (function [2, 14] - [2, 29]
                parameter: (value_identifier [2, 14] - [2, 15])
                body: (binary_expression [2, 19] - [2, 29]
                  left: (number [2, 19] - [2, 20])
                  right: (call_expression [2, 23] - [2, 29]
                    function: (value_identifier [2, 23] - [2, 26])
                    arguments: (arguments [2, 26] - [2, 29]
                      (value_identifier [2, 27] - [2, 28]))))))))))))

Playground Example

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions