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:
Curt Hagenlocher
2023-09-30 18:54:48 -07:00
committed by GitHub
parent 1fdb5d263a
commit f4e23bf91e
13 changed files with 248 additions and 217 deletions

View File

@@ -33,25 +33,6 @@ public class UnionInNestedNSUnion {
}
}
static public class UnionInNestedNSVerify
{
static public bool Verify(Google.FlatBuffers.Verifier verifier, byte typeId, uint tablePos)
{
bool result = true;
switch((UnionInNestedNS)typeId)
{
case UnionInNestedNS.TableInNestedNS:
result = NamespaceA.NamespaceB.TableInNestedNSVerify.Verify(verifier, tablePos);
break;
default: result = true;
break;
}
return result;
}
}
public class UnionInNestedNSUnion_JsonConverter : Newtonsoft.Json.JsonConverter {
public override bool CanConvert(System.Type objectType) {
return objectType == typeof(UnionInNestedNSUnion) || objectType == typeof(System.Collections.Generic.List<UnionInNestedNSUnion>);
@@ -94,4 +75,23 @@ public class UnionInNestedNSUnion_JsonConverter : Newtonsoft.Json.JsonConverter
}
static public class UnionInNestedNSVerify
{
static public bool Verify(Google.FlatBuffers.Verifier verifier, byte typeId, uint tablePos)
{
bool result = true;
switch((UnionInNestedNS)typeId)
{
case UnionInNestedNS.TableInNestedNS:
result = NamespaceA.NamespaceB.TableInNestedNSVerify.Verify(verifier, tablePos);
break;
default: result = true;
break;
}
return result;
}
}
}