mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-02 20:18:18 +00:00
[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:
@@ -425,7 +425,7 @@ class KotlinGenerator : public BaseGenerator {
|
|||||||
(nameprefix + (field.name + "_")).c_str());
|
(nameprefix + (field.name + "_")).c_str());
|
||||||
} else {
|
} else {
|
||||||
writer.SetValue("type", GenMethod(field.value.type));
|
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.SetValue("cast", CastToSigned(field.value.type));
|
||||||
writer += "builder.put{{type}}({{argname}}{{cast}})";
|
writer += "builder.put{{type}}({{argname}}{{cast}})";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user