andrewhickman / prost-reflect

A protobuf library extending prost with reflection support and dynamic messages.
https://crates.io/crates/prost-reflect
Apache License 2.0
91 stars 21 forks source link

Incorrect name resolution when files aren't imported #57

Closed andrewhickman closed 1 year ago

andrewhickman commented 1 year ago

Given a set of files like

file1.proto:

package bar;
message Foo {}

file2.proto:

message Foo {}

file3.proto:

import "file2.proto";

package bar;

message Bar {
  optional Foo foo = 1;
}

the type of bar.Bar.foo will be incorrectly resolved to bar.Foo. protoc instead recognizes that file1.proto isn't imported, and resolves it to Foo.