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

Error with doubly nested messages generating back type constructor reference #96

Open
lgastako opened this issue Oct 9, 2019 · 1 comment

Comments

@lgastako
Copy link

lgastako commented Oct 9, 2019

Hi. I'm trying to generate an rpc client for grakn using the protocol definitions from https://github.com/graknlabs/protocol and one of them has a doubly nested message, which we've extracted into a minimal test case here:

syntax = "proto3";

package repro;

message Transaction {
  message Query {
    message Req {
      INFER infer = 1;
    }
    enum INFER {
      TRUE = 0;
      FALSE = 1;
    }
  }
}

message Query2 {
  message Req2 {
     INFER2 infer = 1;
  }
  enum INFER2 {
     TRUE = 0;
     FALSE = 1;
  }
}

The Query2 case works fine (as expected) but the case where it's nested inside Transaction in an additional level of nesting generates a reference to Repro.Query_INFER rather than to Repro.Transaction_Query_INFER which causes this error:

gen/Repro.hs:121:77-93: error: …
    Not in scope: type constructor or class ‘Repro.Query_INFER’
    Perhaps you meant ‘Repro.Query2_INFER2’ (line 323)
    No module named ‘Repro’ is imported.
    |
Compilation failed.

I can work around this for the moment by editing the generated code but obviously that's not a good long term solution.

@lgastako
Copy link
Author

lgastako commented Oct 9, 2019

You can see the actual generated code here: https://gist.github.com/lgastako/71bad8ecbedaaa6fbbcb0942773f5e3e

RichardWarfield pushed a commit to litxio/gRPC-haskell that referenced this issue Apr 25, 2023
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