flatbuffers
flatbuffers copied to clipboard
[TS] wrong code generation for colliding type names and non root_type
If you use same type name in different namespaces and use them in a non root_type, flatc will generate wrong code. Minimal example:
namespace foo;
table MyType {
value :uint32;
}
namespace bar;
table MyType {
value : foo.MyType;
}
table zz {
}
root_type zz;
Code for bar.MyType will not compile. Name clash of MyType will not be detected. Fix is to always do the special case for root structs: https://github.com/google/flatbuffers/blob/master/src/idl_gen_ts.cpp#L1560