DerrickBrayanClayton / protobuf-net

Automatically exported from code.google.com/p/protobuf-net
0 stars 0 forks source link

Generated class has compilation problem #92

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I generated class from my protocol, but it generates incorrectly. It's not
because DLL-references. Protobuf generates code like this 
Type1.Field1 _field = Type1.Field1.;

And I have problems with parsing this Type1 even if I make changes like this:
Type1.Field1 _field = Type1.Field1.CONST_1;
because I can not correctly parse this field - it's parsing to null!

Original issue reported on code.google.com by danilchenko.andrey on 12 Feb 2010 at 1:28

GoogleCodeExporter commented 8 years ago
Do you have a sample proto that causes this? (ideally just a minimal example)

Original comment by marc.gravell on 12 Feb 2010 at 1:36

GoogleCodeExporter commented 8 years ago
message Type1 {
    optional Enum1 = 1
}

enum Enum1 { CONST1 = 1; CONST2 = 2; }

Original comment by danilchenko.andrey on 12 Feb 2010 at 1:53

GoogleCodeExporter commented 8 years ago
OK, that is odd. I'll investigate.

Original comment by marc.gravell on 12 Feb 2010 at 1:55

GoogleCodeExporter commented 8 years ago
Hi Marc, thanks for your work on this project.  I am also having this issue.  
Is there a fix for this, or an ETA?  

It works fine if you specify a default value,e.g. [default = CONST1] but I 
don't have control over the proto files. Per the language's definition: "For 
enums, the default value is the first value listed in the enum's type 
definition." 

Thanks in advance for your reply.

Original comment by zch...@gmail.com on 22 Jul 2011 at 3:36

GoogleCodeExporter commented 8 years ago
It's worth to mention that my enum is defined in another proto file.

Original comment by zch...@gmail.com on 22 Jul 2011 at 3:47