mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-03 04:21:13 +00:00
[idl_parser] Mark typefield as deprecated (#5958)
* Mark typefield as deprecated * Add UnionDeprecation Test. * Update to use evolution schema instead. * Use --scoped-enums to compile.
This commit is contained in:
@@ -878,6 +878,11 @@ CheckedError Parser::ParseField(StructDef &struct_def) {
|
||||
val->constant = NumToString(id - 1);
|
||||
typefield->attributes.Add("id", val);
|
||||
}
|
||||
// if this field is a union that is deprecated,
|
||||
// the automatically added type field should be deprecated as well
|
||||
if (field->deprecated) {
|
||||
typefield->deprecated = true;
|
||||
}
|
||||
}
|
||||
|
||||
EXPECT(';');
|
||||
|
||||
Reference in New Issue
Block a user