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

Generator: does not seem to use opened modules #34

Open
Cjen1 opened this issue Feb 25, 2020 · 0 comments
Open

Generator: does not seem to use opened modules #34

Cjen1 opened this issue Feb 25, 2020 · 0 comments

Comments

@Cjen1
Copy link

Cjen1 commented Feb 25, 2020

If I have two files as follows:

a.ml

module Foo = struct
type value = int [@@deriving protobuf {protoc }

and b.ml

open A
type value2 = Foo.value
type value3 = {value: value2} [@@deriving protobuf {protoc}]

the generated protobuffer for b will be approximately:

import "A.Foo.protoc"
message value2 {
  required Foo.value _ = 1;
}

message value3 {
  required value2 value = 1;
}

This however won't compile since Foo.value is undefined, but A.Foo.value is defined.

If in b.ml:

type value2 = A.Foo.value

Then A.Foo.value is generated instead.

My suggestion would be to just amend the readme to fix this if a more correct fix is not possible.

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

1 participant