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

Implicit search in presence of polymorphic variants #27

Open
LeoTestard opened this issue Oct 29, 2014 · 1 comment
Open

Implicit search in presence of polymorphic variants #27

LeoTestard opened this issue Oct 29, 2014 · 1 comment

Comments

@LeoTestard
Copy link
Contributor

The following code doesn't compile

module type Foo = sig
    type 'a t
    val f : 'a t -> int
end

implicit module Foo1 = struct
    type 'a t = unit
    let f () = 0
end

implicit module Foo2 = struct
    type 'a t = [> `Foo | `Bar ] as 'a
    let f (_: 'a t) = 0
end

let f (implicit M: Foo) x = M.f x

let () =
    f `Foo ;
    ()

cc @def-lkb

@yallop
Copy link
Contributor

yallop commented Aug 15, 2015

This looks like expected behaviour. The code doesn't compile because the module Foo2 doesn't match the module type Foo.

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