[Kotlin] Fix missing escape for struct construction statements (#6877)

An escaping was missing leading to wrong generation when using
kotlin keywords.
This commit is contained in:
Paulo Pinheiro 2021-10-07 22:00:07 +02:00 committed by GitHub
parent 31bb0b9726
commit 38295a1873
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -425,7 +425,7 @@ class KotlinGenerator : public BaseGenerator {
(nameprefix + (field.name + "_")).c_str());
} else {
writer.SetValue("type", GenMethod(field.value.type));
writer.SetValue("argname", nameprefix + MakeCamel(field.name, false));
writer.SetValue("argname", nameprefix + MakeCamel(Esc(field.name), false));
writer.SetValue("cast", CastToSigned(field.value.type));
writer += "builder.put{{type}}({{argname}}{{cast}})";
}