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

self-import of module types #12

Closed
smolkaj opened this issue May 19, 2017 · 4 comments
Closed

self-import of module types #12

smolkaj opened this issue May 19, 2017 · 4 comments

Comments

@smolkaj
Copy link

smolkaj commented May 19, 2017

While importing types from the own *.mli file works fine as demonstrated in src_test/test_self_import.{ml,mli}, self-importing module types doesn't seem to work:

test_self_import_module_type.ml

module type S = [%import: (module Test_self_import_module_type.S)]

test_self_import_module_type.mli

module type S = sig
  val flag : bool
end

compilation:

Circular build detected
  (src_test/test_self_import_module_type.cmx already seen in [
                                                         src_test/test_self_import_module_type
                                                         ])

Is this a known limitation? This would be very useful!

@whitequark
Copy link
Contributor

Bug. At the moment I have no time to implement this but will review and accept a PR.

@smolkaj
Copy link
Author

smolkaj commented May 20, 2017

@xguerin, I saw that you implemented self-import for types in #10. Any chance you may have the cycles to take a look at this? I would certainly appreciate it.

@xguerin
Copy link
Contributor

xguerin commented May 20, 2017

I planned to look into it as a next step. I'm not sure when I'll get a chance to look at it but that's certainly on my todo list.

@whitequark
Copy link
Contributor

Fixed by #14

ejgallego added a commit to ejgallego/opam-repository that referenced this issue Nov 10, 2018
CHANGES:

1.6
---

  * ocaml-migrate-parsetree + dune support ocaml-ppx/ppx_import#26
    (Jérémie Dimino & Emilio Jesús Gallego Arias)

  * Move to OPAM 2.0, adapt Travis CI.
    (Emilio Jesús Gallego Arias)

1.5
---

  * OCaml 4.07 support
    ocaml-ppx/ppx_import#24
    (Damien Doligez)

  * Call the type-checker (through compiler-libs) instead of reading
    `.cmi` files directly, to correctly resolve module aliases.
    ocaml-ppx/ppx_import#25
    (Gabriel Scherer)

1.4
---

  * OCaml 4.06 support
    ocaml-ppx/ppx_import#19
    (Gabriel Scherer)

1.3
---

  * Also allow extraction of module types from the current module's interface file.
    ocaml-ppx/ppx_import#12
    (Xavier Guérin)

1.2
---

  * Allow extracting types from the current module's interface file.
    (Xavier Guérin)

1.1
---

  * OCaml 4.03 support.
    (whitequark)

1.0
---

  * Allow extracting types from module types.
    (whitequark)

0.1
---

  * Initial release.
    (whitequark)
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

3 participants