Commit 9fb195cc authored by Bryan Furia's avatar Bryan Furia Committed by Wouter van Oortmerssen

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

parent 7836e65d
...@@ -843,12 +843,7 @@ CheckedError Parser::ParseField(StructDef &struct_def) { ...@@ -843,12 +843,7 @@ CheckedError Parser::ParseField(StructDef &struct_def) {
"nested_flatbuffer attribute may only apply to a vector of ubyte"); "nested_flatbuffer attribute may only apply to a vector of ubyte");
// This will cause an error if the root type of the nested flatbuffer // This will cause an error if the root type of the nested flatbuffer
// wasn't defined elsewhere. // wasn't defined elsewhere.
LookupCreateStruct(nested->constant); field->nested_flatbuffer = 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);
} }
if (field->attributes.Lookup("flexbuffer")) { if (field->attributes.Lookup("flexbuffer")) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment