From 69d3fec488524df4ceb3e8dd79cf8902d24efdda Mon Sep 17 00:00:00 2001 From: Jack Zhou Date: Mon, 30 Sep 2019 14:50:03 -0400 Subject: [PATCH] Fix namespaced struct/field name collision detection (#5540) (#5545) Changes the use of `LookupStruct` to `LookupCreateStruct` in `ParseField` to also detect when collisions happen in namespaces. --- src/idl_parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/idl_parser.cpp b/src/idl_parser.cpp index 50d59a225..bc3d063d6 100644 --- a/src/idl_parser.cpp +++ b/src/idl_parser.cpp @@ -677,7 +677,7 @@ CheckedError Parser::AddField(StructDef &struct_def, const std::string &name, CheckedError Parser::ParseField(StructDef &struct_def) { 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"); std::vector dc = doc_comment_;