mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-23 05:30:03 +00:00
Changes the use of `LookupStruct` to `LookupCreateStruct` in `ParseField` to also detect when collisions happen in namespaces.
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
cfb4ecf6f0
commit
69d3fec488
@@ -677,7 +677,7 @@ CheckedError Parser::AddField(StructDef &struct_def, const std::string &name,
|
|||||||
CheckedError Parser::ParseField(StructDef &struct_def) {
|
CheckedError Parser::ParseField(StructDef &struct_def) {
|
||||||
std::string name = attribute_;
|
std::string name = attribute_;
|
||||||
|
|
||||||
if (LookupStruct(name))
|
if (LookupCreateStruct(name, false, false))
|
||||||
return Error("field name can not be the same as table/struct name");
|
return Error("field name can not be the same as table/struct name");
|
||||||
|
|
||||||
std::vector<std::string> dc = doc_comment_;
|
std::vector<std::string> dc = doc_comment_;
|
||||||
|
|||||||
Reference in New Issue
Block a user