flatbuffers icon indicating copy to clipboard operation
flatbuffers copied to clipboard

[Go] Fix GenNativeUnionUnPack for imported union type.

Open Gh0u1L5 opened this issue 3 years ago • 1 comments

Consider the following fbs definitions:

package/type.fbs

namespace root.package;

table Type {}

union.fbs

include "./package/type.fbs";

namespace root;

union Union {
  package.Type,
}

One would expect it to work fluently with --go --gen-all --gen-object-api. However, the generated codes won't compile due to accessing private fields defined in another package. This PR fixes this issue.

Gh0u1L5 avatar Oct 12 '22 06:10 Gh0u1L5

@dbaileychess Yep, I just noticed that I've forgotten to update the generated results. The commit https://github.com/google/flatbuffers/pull/7579/commits/69600e3200964227156981cf0c02facf568e8518 should be enough to show the modifications.

Gh0u1L5 avatar Oct 31 '22 07:10 Gh0u1L5