You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the problem here is that foo takes an implicit module that contains a functor and add constraints on an instance of this functor (the B.R(INT).t parameter).
Constraints propagated from an instance of a functor are not yet supported.
OK, thanks. I think I'm giving up on using implicits for what I was trying to use.
I also think that if I change the implicit argument to the explicit argument, the program shouldn't type-check anyway, because a first class module cannot be bound in a type signature, right? I.e.:
val foo : (module B : BAR ) -> B.R(INT).t -> int
is not a valid OCaml program (with first-class modules).
(The above bug is still a bug, because the compiler shouldn't crash ;).)
Indeed, normal ocaml arrows don't bind anything in the environment.
The correct syntax is then (module BAR) and there is no way to refer to the type of an applied functor.
(let foo (module B : BAR) = ... is accepted, but the typechecker will enforce that no name from B escapes)
let-def
changed the title
Compiler crashes with assertion
Compiler crashes with assertion when constraining instances of an implicit functor
Sep 11, 2017
With the attached file path_error.ml.txt the following crashes:
The text was updated successfully, but these errors were encountered: