cjyyyza / protobuf-net

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

DefaultValue incorrectly handled for non-CLS compliant types #164

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Define a protobuf with a field like "optional fixed64 job_id_source = 10 
[default = 18446744073709551615];"
2. Compile protobuf with protogen
3. Try to instantiate the proto class

What is the expected output? What do you see instead?

The default value is expected to be "18446744073709551615" while the observed 
result is a floating point number.

Please provide any additional information below.

The constructors for ComponentModel.DefaultValue do not include ulong, so I've 
attached my solution to this: creating a child DefaultValue attribute.

The IsValidBinary function also incorrectly classified my .proto files as 
binary files.

Original issue reported on code.google.com by AzuiSl...@gmail.com on 24 Mar 2011 at 5:50

Attachments:

GoogleCodeExporter commented 9 years ago
I suspect using the string constructor may be simpler, but will look

Original comment by marc.gravell on 24 Mar 2011 at 8:14