flatbuffers
flatbuffers copied to clipboard
[Rust] [Reflection] `get_field_vector()` only works for vectors of primitive types
The test on https://github.com/google/flatbuffers/blob/master/rust/reflection/src/lib.rs#L185 requires that the size of T is equal to get_type_size() of the field element base type. However, if the base type is Obj and e.g. T is Table or a 16-byte struct of 4 floats, this will fail, because get_type_size() always returns 4 for Obj.
Upon closer inspection, it seems that this behavior is copied verbatim from the C++ implementation. The original authors do seem to have been aware of this though given VerifyVectorOfStructs() doesn't use GetFieldV() at all.
reopening - I think this got closed by merge into the forked repo