google / flatbuffers

FlatBuffers: Memory Efficient Serialization Library
https://flatbuffers.dev/
Apache License 2.0
22.56k stars 3.19k forks source link

[C#] Failed to generate Verifier for Union type [flatc version 23.5.26] #8197

Closed KotoriK closed 1 day ago

KotoriK commented 6 months ago

Brief

affected language: C#,csharp flatc version 23.5.26 flatc option: -n --gen-onefile

Test Schema

namespace Test;
table A{
    a:string;
}
table B{
    b:uint;
}
union Un{
    A,
    B
}
table T{
    u:Un;
}
root_type T;

Generated Code Snippet

static public class TVerify
{
  static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos)
  {
    return verifier.VerifyTableStart(tablePos)
      && verifier.VerifyField(tablePos, 4 /*UType*/, 1 /*Test.Un*/, 1, false)
      && verifier.VerifyUnion(tablePos, 4, 6 /*U*/, Test.UnVerify.Verify, false) // Test.UnVerify is referenced here but not defined anywhere
      && verifier.VerifyTableEnd(tablePos);
  }
}

Expected behaviour

Define Test.UnVerify.Verify in flatc generated code.

github-actions[bot] commented 2 weeks ago

This issue is stale because it has been open 6 months with no activity. Please comment or label not-stale, or this will be closed in 14 days.

github-actions[bot] commented 1 day ago

This issue was automatically closed due to no activity for 6 months plus the 14 day notice period.