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

Broken code generated for nested messages #112

Open
neongreen opened this issue Jul 27, 2019 · 3 comments
Open

Broken code generated for nested messages #112

neongreen opened this issue Jul 27, 2019 · 3 comments

Comments

@neongreen
Copy link

$ compile-proto-file --proto test.proto --out .
// test.proto

syntax = "proto3";

package test;

message RateLimitResponse {
  message RateLimit {
    enum Unit {
      SECOND = 0;
      MINUTE = 1;
    }
    uint32 requests_per_unit = 1;
    Unit unit = 2;
  }
  message DescriptorStatus {
    RateLimit current_limit = 1;
    uint32 limit_remaining = 2;
  }
  repeated DescriptorStatus statuses = 1;
}

Compiling this protobuf file results in:

Test.hs:110:66-84: error: …
    Not in scope: type constructor or class ‘Test.RateLimit_Unit’
    No module named ‘Test’ is imported.

The real issue is not that Test is not imported, but that the generated type is called RateLimitResponse_RateLimit_Unit, not RateLimit_Unit.

@neongreen
Copy link
Author

I can contribute a PR. Any pointers to the relevant places in code are appreciated!

@tim2CF
Copy link
Collaborator

tim2CF commented Mar 25, 2021

I have the same issue. Maybe @Gabriel439 can say what exactly needs to be fixed - parsing or rendering? Or maybe AST and then parsing and rendering.

@tim2CF
Copy link
Collaborator

tim2CF commented Mar 26, 2021

might be fixed in this PR
#143

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