cjyyyza / protobuf-net

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

UINT Enums throws exception while serialize #302

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

What steps will reproduce the problem?
1. Define a enum with data type uint e.g.
[Flags]
public enum StateEnum: uint {
      Active = 0x00000001,
      Acknowledged = 0x00000002,
      Deleted = 0x80000000
   }
2. Try to serialize a enum with a value not in range of an int (e.g. 'Deleted')

What is the expected output? 
It should serialize correctly.

What do you see instead?
Instead a exception is thrown at "NormalizeProtoMember"/"fieldNumber = 
Convert.ToInt32(((FieldInfo)member).GetRawConstantValue());"

Version is V2 (r480)

Regards
Thomas

Original issue reported on code.google.com by t.st...@eckelmann.de on 16 Jul 2012 at 11:16

GoogleCodeExporter commented 9 years ago
Acknowledged; this (and a corresponding Ovf glitch) is addressed (test+fix) in 
a pending commit; will commit later today.

Original comment by marc.gravell on 16 Jul 2012 at 12:07