mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-01 19:58:15 +00:00
[C++] Update the validator to skip structs in namespaces other than the current one. (#8324)
* [Python] Generate `.pyi` stub files when `--python-typing` is on. To support this change, the following modifications were made: - added a new option to disable `numpy` helpers generation; - added a new flag to control the target Python version: `--python-version` can be one of the following: - `0.x.x` – compatible with any Python version; - `2.x.x` – compatible with Python 2; - `3.x.x` – compatible with Python 3. - added codegen utilities for Python; - added a note that the generated .py file is empty. * [C++] Update the validator to skip structs in namespaces other than the current one.
This commit is contained in:
@@ -470,7 +470,11 @@ class CppGenerator : public BaseGenerator {
|
||||
|
||||
// Check that nativeName doesn't collide the name of another struct.
|
||||
for (const auto &other_struct_def : parser_.structs_.vec) {
|
||||
if (other_struct_def == struct_def) { continue; }
|
||||
if (other_struct_def == struct_def ||
|
||||
other_struct_def->defined_namespace !=
|
||||
struct_def->defined_namespace) {
|
||||
continue;
|
||||
}
|
||||
|
||||
auto other_name = Name(*other_struct_def);
|
||||
if (nativeName == other_name) {
|
||||
|
||||
Reference in New Issue
Block a user