Closed hehaoqian closed 10 months ago
The following flatbuffer schema does not compile with flatcc, but is okay with flatc
flatcc
flatc
table Alice { } table Bob { } union Bar { a:Alice, b:Bob, } table Foo { bar:Bar (id: 1); }
Error message:
test.fbs:16:12: error: 'id': id attribute value should be larger to accommodate hidden union type field output failed
This issue only happens if union id is set to 1. Set to other id works.
table Alice { } table Bob { } union Bar { a:Alice, b:Bob, } table Foo { a:uint64 (id: 0); bar:Bar (id: 2); }
Thanks. The union logic assumed 1 was the smallest id, when in fact 0 is a valid id. Fixed in https://github.com/dvidelabs/flatcc/commit/354a5f905162cf5ae3bdfbfbc9d6c57411ec3404
The following flatbuffer schema does not compile with
flatcc
, but is okay withflatc
Error message:
This issue only happens if union id is set to 1. Set to other id works.