mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-03 04:21:13 +00:00
Fix verification for C# unions (#7970)
* Fix verification for unions * Run scripts\generate_code.py --------- Co-authored-by: Michael Le <michael.le647@gmail.com>
This commit is contained in:
@@ -431,6 +431,10 @@ class CSharpGenerator : public BaseGenerator {
|
||||
if (opts.generate_object_based_api) {
|
||||
GenEnum_ObjectAPI(enum_def, code_ptr, opts);
|
||||
}
|
||||
|
||||
if (enum_def.is_union) {
|
||||
code += GenUnionVerify(enum_def.underlying_type);
|
||||
}
|
||||
}
|
||||
|
||||
bool HasUnionStringValue(const EnumDef &enum_def) const {
|
||||
@@ -1755,8 +1759,6 @@ class CSharpGenerator : public BaseGenerator {
|
||||
code += " }\n";
|
||||
code += "}\n\n";
|
||||
|
||||
code += GenUnionVerify(enum_def.underlying_type);
|
||||
|
||||
// JsonConverter
|
||||
if (opts.cs_gen_json_serializer) {
|
||||
if (enum_def.attributes.Lookup("private")) {
|
||||
|
||||
Reference in New Issue
Block a user