google / flatbuffers

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

Improve error handling on Object API name collision. #8275

Closed mbeards closed 3 months ago

mbeards commented 3 months ago

If a schema contains a message named e.g. FooT and a message named Foo while the Object API suffix is T, then two classes with colliding names will be generated. This scenario will produce a C++ compiler error, but it's confusing.

This patch moves the error to the compiler, allowing the user to more readily act to correct the issue.