Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
KotoriK opened this issue Dec 27, 2023 · 0 comments
Open

Comments

@KotoriK
Copy link

KotoriK commented Dec 27, 2023

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.

@KotoriK KotoriK changed the title Failed to generate Verifier for Union type [C#, flatc version 23.5.26] [C#] Failed to generate Verifier for Union type [flatc version 23.5.26] Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant