gRPC-haskell
gRPC-haskell copied to clipboard
Error with doubly nested messages generating back type constructor reference
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.
You can see the actual generated code here: https://gist.github.com/lgastako/71bad8ecbedaaa6fbbcb0942773f5e3e