[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:
Liu Liu
2020-06-15 23:18:12 -07:00
committed by GitHub
parent 9ab4a5c0e2
commit cc44a44427
8 changed files with 157 additions and 46 deletions

View File

@@ -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(';');