forked from BigfootDev/flatbuffers
Copying required field to union type vector (#4407)
* Eclipse ignore * TypeScript support * Prefixing enums * Test results * Merged JS and TS generators * Fixed AppVeyor build problems * Fixed more AppVeyor build problems * Fixed more AppVeyor build problems * Changed TS flag to options struct * Storing options by value * Removed unneeded const * Re-export support for unions * Uint support * Casting bools to numbers for mutation * TS shell tests * Reverted generates js test file to original version * Backing up js tests and properly generating test data * Not importing flatbuffers for TS test generation * Not overwriting generated js for tests * AppVeyor test fixes * Generating the most strict TS code possible * Not returning null when creating vectors * Not returning null from struct contructors * Copying required field to union type vector * Removed unneccessary bool
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
a6a3f59253
commit
7cc72e4b11
@@ -745,6 +745,10 @@ CheckedError Parser::ParseField(StructDef &struct_def) {
|
||||
}
|
||||
|
||||
if (typefield) {
|
||||
if (!IsScalar(typefield->value.type.base_type)) {
|
||||
// this is a union vector field
|
||||
typefield->required = field->required;
|
||||
}
|
||||
// If this field is a union, and it has a manually assigned id,
|
||||
// the automatically added type field should have an id as well (of N - 1).
|
||||
auto attr = field->attributes.Lookup("id");
|
||||
|
||||
Reference in New Issue
Block a user