Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module unpack fails #251

Open
CarlOlson opened this issue Jun 27, 2024 · 0 comments
Open

Module unpack fails #251

CarlOlson opened this issue Jun 27, 2024 · 0 comments

Comments

@CarlOlson
Copy link
Contributor

module type T = {
  type t
}

module T = {
  type t
}

let make = (): module(T) => module(T)

module T2 = unpack(make(): T)

Playground

(source_file [0, 0] - [11, 0]
  (module_declaration [0, 0] - [2, 1]
    (module_binding [0, 12] - [2, 1]
      name: (module_identifier [0, 12] - [0, 13])
      definition: (block [0, 16] - [2, 1]
        (type_declaration [1, 2] - [1, 8]
          (type_binding [1, 7] - [1, 8]
            name: (type_identifier [1, 7] - [1, 8]))))))
  (module_declaration [4, 0] - [6, 1]
    (module_binding [4, 7] - [6, 1]
      name: (module_identifier [4, 7] - [4, 8])
      definition: (block [4, 11] - [6, 1]
        (type_declaration [5, 2] - [5, 8]
          (type_binding [5, 7] - [5, 8]
            name: (type_identifier [5, 7] - [5, 8]))))))
  (let_declaration [8, 0] - [8, 37]
    (let_binding [8, 4] - [8, 37]
      pattern: (value_identifier [8, 4] - [8, 8])
      body: (function [8, 11] - [8, 37]
        parameters: (formal_parameters [8, 11] - [8, 13])
        return_type: (type_annotation [8, 13] - [8, 24]
          (module_pack [8, 15] - [8, 24]
            (module_identifier [8, 22] - [8, 23])))
        body: (module_pack [8, 28] - [8, 37]
          (module_identifier [8, 35] - [8, 36])))))
  (module_declaration [10, 0] - [10, 29]
    (module_binding [10, 7] - [10, 29]
      name: (module_identifier [10, 7] - [10, 9])
      definition: (module_unpack [10, 12] - [10, 29]
        (call_expression [10, 19] - [10, 25]
          function: (value_identifier [10, 19] - [10, 23])
          arguments: (arguments [10, 23] - [10, 25]))
        (ERROR [10, 25] - [10, 28])))))
Test.res           0.31 ms         401 bytes/ms (ERROR [10, 25] - [10, 28])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant