mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-21 14:15:46 +00:00
Refactor FieldDef to model presense as an enum rather than 2 bools. (#6420)
* Define presence. * Migrate to IsRequired and IsOptional methods * moved stuff around * Removed optional and required bools from FieldDef * change assert to return error * Fix tests.cpp * MakeFieldPresence helper * fmt * old c++ compatibility stuff Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
@@ -646,7 +646,7 @@ class KotlinGenerator : public BaseGenerator {
|
||||
writer.IncrementIdentLevel();
|
||||
for (auto it = field_vec.begin(); it != field_vec.end(); ++it) {
|
||||
auto &field = **it;
|
||||
if (field.deprecated || !field.required) { continue; }
|
||||
if (field.deprecated || !field.IsRequired()) { continue; }
|
||||
writer.SetValue("offset", NumToString(field.value.offset));
|
||||
writer += "builder.required(o, {{offset}})";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user