forked from BigfootDev/flatbuffers
[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