mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 04:04:19 +00:00
Passed field name as prefix for nested structs
This pull request should fix #232. Pass field name instead of struct name as nameprefix for nested structures. Continuously concatenate nameprefix arguments to support deeper nested structures.
This commit is contained in:
@@ -450,7 +450,7 @@ static void GenStructArgs(const LanguageParameters &lang,
|
||||
// don't clash, and to make it obvious these arguments are constructing
|
||||
// a nested struct, prefix the name with the struct name.
|
||||
GenStructArgs(lang, *field.value.type.struct_def, code_ptr,
|
||||
(field.value.type.struct_def->name + "_").c_str());
|
||||
(nameprefix + (field.name + "_")).c_str());
|
||||
} else {
|
||||
code += ", ";
|
||||
code += GenTypeForUser(lang,
|
||||
|
||||
Reference in New Issue
Block a user