tafia / quick-protobuf

A rust implementation of protobuf parser
MIT License
452 stars 87 forks source link

bug: pb-rs thinks a struct is in a different module than it is #170

Closed benma closed 1 year ago

benma commented 4 years ago

I made a repo to reproduce the issue here:

https://github.com/benma/quick-protobuf-issue

pb-rs seems to have trouble with imports in this scenario:

common.proto:

syntax = "proto3";

message Common {
}

b.proto:

syntax = "proto3";
import "common.proto";

message B {
  Common common = 1;
}

a.proto:

syntax = "proto3";

import "common.proto";
import "b.proto";

message A {
  Common common = 1;
  B b = 2;
}

in the generated a.rs, the Common struct is qualified with b::Common instead of with common::Common. in b.rs, everything is correct.