mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 10:38:20 +00:00
Improve error message for an enum name conflicting with non-enum ID
This commit is contained in:
parent
4a9567e04f
commit
69c0cf1513
3 changed files with 10 additions and 0 deletions
|
@ -1269,6 +1269,7 @@ void EnumType::CheckAndAddName(const string& module_name, const char* name,
|
|||
// cyclic dependencies.
|
||||
string fullname = make_full_var_name(module_name.c_str(), name);
|
||||
if ( id->Name() != fullname
|
||||
|| ! id->IsEnumConst()
|
||||
|| (id->HasVal() && val != id->GetVal()->AsEnum())
|
||||
|| GetName() != id->GetType()->GetName()
|
||||
|| (names.find(fullname) != names.end() && names[fullname] != val) )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue