status-im / nim-protobuf-serialization

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem with enum value greater than 255

lchenut opened this issue · comments

type
  RandomEnum = enum
    AAA = 0
    BBB = 256

  RandomObject {.protobuf3.} = object
    e {.fieldNumber: 1.}: RandomEnum

let o = RandomObject(e: AAA)
let oEncoded = Protobuf.encode(o)
assert(o == Protobuf.decode(oEncoded, RandomObject))

Make the compilation stopped with this message:
protobuf_serialization/numbers/varint.nim(192, 12) Error: fatal error: Tried to decode a raw binary value into an encoding with a different size. This should never happen.

#36 removes enum support temporarily