Yep, you've found one of many ways that you can make protoc generate code
that does not compile.  Unfortunately it would be extremely difficult and
tedious for us to fix every possible instance of this -- most of the
problems are things no one has even thought of yet -- so we try to focus
only on the ones that are likely to happen in practice.

On Fri, May 29, 2009 at 3:24 PM, <> wrote:

> I just found a bug compiling a .proto file:
> message Zoo {
>    message Snark {
>        optional bool isBoojum = 4;
>    }
>    repeated Snark snarks = 1;
> }
> If I name this file Zoo.proto, compiling it will give me a "duplicate
> name" error, and tell me I can't use "Zoo" as the name of the file and
> a message. But if I name the file Snark.proto, it won't give me that
> message. Instead, it will generate a java file that won't compile
> because it contains two classes named "Snark." It really should give
> the same message I get when I name it Zoo.proto.
> -- Miguel Muñoz
> >

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to