mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00
GH-1211: Improve error message for already-defined functions
This commit is contained in:
parent
b73cc816e9
commit
8c85f2135e
3 changed files with 18 additions and 1 deletions
|
@ -583,7 +583,7 @@ void begin_func(IDPtr id, const char* module_name,
|
|||
|
||||
case FUNC_FLAVOR_FUNCTION:
|
||||
if ( ! id->IsRedefinable() )
|
||||
id->Error("already defined");
|
||||
id->Error("already defined", t.get());
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -594,6 +594,10 @@ void begin_func(IDPtr id, const char* module_name,
|
|||
else
|
||||
id->SetType(t);
|
||||
|
||||
if ( IsErrorType(id->GetType()->Tag()) )
|
||||
reporter->FatalError("invalid definition of '%s' (see previous errors)",
|
||||
id->Name());
|
||||
|
||||
const auto& args = t->Params();
|
||||
const auto& canon_args = id->GetType()->AsFuncType()->Params();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue