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

Assertion error with implicit of abstract module type #11

Open
yallop opened this issue Sep 17, 2014 · 1 comment
Open

Assertion error with implicit of abstract module type #11

yallop opened this issue Sep 17, 2014 · 1 comment

Comments

@yallop
Copy link
Contributor

yallop commented Sep 17, 2014

# module F(X : sig module type T end) =
struct
  let f (implicit Y:X.T) () = ()
  let _ = f ()
end
;;
Fatal error: exception File "typing/implicitsearch.ml", line 400, characters 26-32: Assertion failed
@let-def
Copy link
Contributor

let-def commented Sep 18, 2014

I don't know how to interpret search for an abstract module type.
Of course, a clean error message should be provided. Or maybe there is a cleaner way of handling this case?

Maybe treating X.T path as a witness for a module type and searching for implicits in scope having this name as type?

This would allow:

module F(X : sig module type T module M : T end) =
struct
  let f (implicit Y:X.T) () = ()
  implicit module M = X.M
  let _ = f ()
end

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

2 participants