mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 23:58:20 +00:00
Improve error for invalid use of types as values (addresses #923).
This scripting error can now generate an error message at parse-time instead of run-time and also includes location information.
This commit is contained in:
parent
ea6b62f586
commit
2f0c698ed5
4 changed files with 21 additions and 2 deletions
|
@ -233,7 +233,11 @@ NameExpr::NameExpr(ID* arg_id, bool const_init) : Expr(EXPR_NAME)
|
|||
{
|
||||
id = arg_id;
|
||||
in_const_init = const_init;
|
||||
SetType(id->Type()->Ref());
|
||||
|
||||
if ( id->AsType() )
|
||||
SetType(new TypeType(id->AsType()));
|
||||
else
|
||||
SetType(id->Type()->Ref());
|
||||
|
||||
EventHandler* h = event_registry->Lookup(id->Name());
|
||||
if ( h )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue