Commit 69d3fec4 authored by Jack Zhou's avatar Jack Zhou Committed by Wouter van Oortmerssen

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.
parent cfb4ecf6
......@@ -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<std::string> dc = doc_comment_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment