ocamllabs / ocaml-modular-implicits

OCaml extended with modular implicits
Other
103 stars 8 forks source link

Syntax error in module constraint inside an implicit argument #54

Closed ohad closed 7 years ago

ohad commented 7 years ago

I'm getting a syntax error in test.ml.txt at: let gnu { X : Sig2 with module A = Bar} = 1 while let gnat { X : Sig2 with type t = int} = 1 works fine.

> opam switch
4.02.0+modular-implicits      C 4.02.0+modular-implicits      OCaml 4.02, with support for modular implicits.
ohad commented 7 years ago

Ooops, not a bug --- see first class modules in the manual, package-constraints in first-class modules cannot constrain a module.

lpw25 commented 7 years ago

Yeah, we follow the same restriction as first-class modules at the moment. There's no fundamental reason it couldn't be extended to allow any module type, but the implementation is quite a bit easier this way.