mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 09:08:20 +00:00
GH-1740: Report a better error message if table key is not a list
This commit is contained in:
parent
c7eef7b094
commit
c15a9eab7f
1 changed files with 4 additions and 1 deletions
|
@ -2626,7 +2626,7 @@ TypePtr AssignExpr::InitType() const
|
||||||
{
|
{
|
||||||
if ( op1->Tag() != EXPR_LIST )
|
if ( op1->Tag() != EXPR_LIST )
|
||||||
{
|
{
|
||||||
Error("bad initializer");
|
Error("bad initializer, first operand should be a list");
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3490,7 +3490,10 @@ TableConstructorExpr::TableConstructorExpr(ListExprPtr constructor_list,
|
||||||
SetType(init_type(op.get()));
|
SetType(init_type(op.get()));
|
||||||
|
|
||||||
if ( ! type )
|
if ( ! type )
|
||||||
|
{
|
||||||
SetError();
|
SetError();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
else if ( type->Tag() != TYPE_TABLE || type->AsTableType()->IsSet() )
|
else if ( type->Tag() != TYPE_TABLE || type->AsTableType()->IsSet() )
|
||||||
SetError("values in table(...) constructor do not specify a table");
|
SetError("values in table(...) constructor do not specify a table");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue