mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
GH-365: improve un-indexable type error message
This commit is contained in:
parent
aced89ac9e
commit
58d55d0f95
3 changed files with 11 additions and 2 deletions
4
CHANGES
4
CHANGES
|
@ -1,4 +1,8 @@
|
||||||
|
|
||||||
|
2.6-279 | 2019-05-13 20:02:59 -0700
|
||||||
|
|
||||||
|
* GH-365: improve un-indexable type error message (Jon Siwek, Corelight)
|
||||||
|
|
||||||
2.6-277 | 2019-05-08 12:42:18 -0700
|
2.6-277 | 2019-05-08 12:42:18 -0700
|
||||||
|
|
||||||
* Allow tuning Broker log batching via scripts (Jon Siwek, Corelight)
|
* Allow tuning Broker log batching via scripts (Jon Siwek, Corelight)
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
2.6-277
|
2.6-279
|
||||||
|
|
|
@ -2917,7 +2917,12 @@ IndexExpr::IndexExpr(Expr* arg_op1, ListExpr* arg_op2, bool is_slice)
|
||||||
|
|
||||||
int match_type = op1->Type()->MatchesIndex(arg_op2);
|
int match_type = op1->Type()->MatchesIndex(arg_op2);
|
||||||
if ( match_type == DOES_NOT_MATCH_INDEX )
|
if ( match_type == DOES_NOT_MATCH_INDEX )
|
||||||
SetError("not an index type");
|
{
|
||||||
|
std::string error_msg =
|
||||||
|
fmt("expression with type '%s' is not a type that can be indexed",
|
||||||
|
type_name(op1->Type()->Tag()));
|
||||||
|
SetError(error_msg.data());
|
||||||
|
}
|
||||||
|
|
||||||
else if ( ! op1->Type()->YieldType() )
|
else if ( ! op1->Type()->YieldType() )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue