google / flatbuffers

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

Invalid Code generation if Property has same name as Struct [Windows/C#/24.3.7] #8256

Open MJE-GTI opened 3 months ago

MJE-GTI commented 3 months ago

The C# Code generation generates invalide Code property in Struct has same name as struct.

a.fbs

struct A {
    a: [ubyte:4];
}

b.fbs

include "./a.fbs";

struct B {
    test: A;
}

I compiled this two files with flatc.exe -o test --csharp --gen-object-api <filename>

The C# Compiler can compile A.cs but not B.cs