diff --git a/src/idl_gen_general.cpp b/src/idl_gen_general.cpp index 9a2132338..9bb411edf 100644 --- a/src/idl_gen_general.cpp +++ b/src/idl_gen_general.cpp @@ -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,