Fix generating nested Flatbuffer accessors when they cross namespaces (#5414)

This commit is contained in:
Bryan Furia
2019-06-24 14:46:00 -04:00
committed by Wouter van Oortmerssen
parent 7836e65dd4
commit 9fb195cce8

View File

@@ -843,12 +843,7 @@ CheckedError Parser::ParseField(StructDef &struct_def) {
"nested_flatbuffer attribute may only apply to a vector of ubyte");
// This will cause an error if the root type of the nested flatbuffer
// wasn't defined elsewhere.
LookupCreateStruct(nested->constant);
// Keep a pointer to StructDef in FieldDef to simplify re-use later
auto nested_qualified_name =
current_namespace_->GetFullyQualifiedName(nested->constant);
field->nested_flatbuffer = LookupStruct(nested_qualified_name);
field->nested_flatbuffer = LookupCreateStruct(nested->constant);
}
if (field->attributes.Lookup("flexbuffer")) {