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_;