Sorry, my mistakes :) But, when I try to give 0 as the enum value, compiler can't compile it. Is it a bug from the compiler? (I use protobuf plugin in neatbeans)
On Apr 19, 12:31 pm, Marc Gravell <marc.grav...@gmail.com> wrote: > You mean this? > > enum PhoneType { > MOBILE = 0; > HOME = 1; > WORK = 2; > } > > message PhoneNumber { > required string number = 1; > optional PhoneType type = 2 [default = HOME]; > > } > > The zero is not a tag / field-number; it is just an enum value. The 2 on the > last line I've copied is a tag relating to a *use* of that enum. > > Marc > > On 19 April 2011 06:28, Canggih <cangca...@gmail.com> wrote: > > > > > hello, i just wanna share. > > > In Protobuf developer guide, in the sample proto file, there is a > > PhoneType enum data type, consist of MOBILE, HOME, and WORK. MOBILE > > use '0' as its tag number, and so on. > > Meanwhile, i'm using Protobuf plugin for Netbeans, for my project. > > When i was try to compile a proto file, there was an error. The error > > was in enum data type. Compiler couldn't compile enum data that had > > '0' tag number. Then, when I change to '1', it can run successfully. > > > Any explanations? > > > Thanks in advance > > Canggih > > > -- > > You received this message because you are subscribed to the Google Groups > > "Protocol Buffers" group. > > To post to this group, send email to protobuf@googlegroups.com. > > To unsubscribe from this group, send email to > > protobuf+unsubscr...@googlegroups.com. > > For more options, visit this group at > >http://groups.google.com/group/protobuf?hl=en. > > -- > Regards, > > Marc -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.