mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-26 21:22:18 +00:00
Fix generating nested Flatbuffer accessors when they cross namespaces (#5414)
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
7836e65dd4
commit
9fb195cce8
@@ -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")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user