Fix missing namespace qualifier in Pack()#8967
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
this fix looks great -- it does appear that the new tests don't explicitly validate the interaction with the native API? Though looking over the PR maybe that detail isn't necessary for this bug? |
|
you are right that the test doesn't use |
Summary
Create*calls inPack()when referencing tables from different namespacesProblem
When a table in namespace
fooreferences a table in namespacenative, thegenerated
Pack()function emittedCreateTableWithNative(...)instead ofnative::CreateTableWithNative(...), causing compilation errors.Fix
Two locations in
GenCreateParaminsrc/idl_gen_cpp.cppnow useWrapInNameSpace()to qualifyCreate*calls with the referenced table'snamespace:
c1: native.TableWithNative)c2: [native.TableWithNative])Test plan
cross_namespace_pack_test.fbsschema with cross-namespace table referencesCrossNamespacePackTest()intest.cppverifies Pack/UnPack round-tripflattestspasses locallyCloses #8948