Skip to content

Commit

Permalink
[C++] Update the validator to skip structs in namespaces other than t…
Browse files Browse the repository at this point in the history
…he 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.
  • Loading branch information
anton-bobukh authored May 29, 2024
1 parent 75f05d6 commit 8755c35
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/idl_gen_cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 8755c35

Please sign in to comment.