Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Namespaces allow field/struct name collisions #5540

@hkmix

Description

@hkmix

Using FlatBuffers 1.10.0, if I try to compile a table that defines a field with the same name as a table, it is correctly rejected, but if the collision is in an included file and the files are namespaced, then the error is not reported. MWE:

// my_data.fbs
namespace test_ns;

table MyData {
    Value:int;
}
// my_test.fbs
include "my_data.fbs";

namespace test_ns;

table Container {
    MyData:MyData;
}

This is accepted and generates output which does not compile because the accessor field name collides with the generated struct name. Is this intentional/a limitation of how collisions are checked for?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions