You state:

 The error was in enum data type. Compiler couldn't compile enum data that
> had '0' tag number.


Without seeing the exact message that the compiler emits, and ideally that
generated code it is trying to compile (just around the enum - not
everything), it is hard to assess where the fault lies.

Marc

On 19 April 2011 06:42, Canggih <[email protected]> wrote:

> Sorry, what do you mean?
>
> On Apr 19, 12:39 pm, Marc Gravell <[email protected]> wrote:
> > hard to say without the *exact* compiler message
> >
> > On 19 April 2011 06:36, Canggih <[email protected]> wrote:
> >
> >
> >
> > > 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 <[email protected]> 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 <[email protected]> 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 [email protected].
> > > > > To unsubscribe from this group, send email to
> > > > > [email protected].
> > > > > 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 [email protected].
> > > To unsubscribe from this group, send email to
> > > [email protected].
> > > 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 [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> 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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to