mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 18:18:19 +00:00
Change table initialization deprecation to error
This commit is contained in:
parent
a105b26692
commit
d5b19c61ff
6 changed files with 7 additions and 26 deletions
13
src/Var.cc
13
src/Var.cc
|
@ -195,18 +195,7 @@ static void make_var(const IDPtr& id, TypePtr t, InitClass c, ExprPtr init,
|
|||
{
|
||||
// This can happen because the grammar allows any "init_class",
|
||||
// including none, to be followed by an expression.
|
||||
// Remove in v6.1 (make an error)
|
||||
reporter->Deprecation(
|
||||
util::fmt("Remove in v6.1. Initialization not preceded by =/+=/-= is deprecated. (%s)",
|
||||
obj_desc_short(init.get()).c_str()),
|
||||
init->GetLocationInfo());
|
||||
|
||||
// The historical instances of these, such as the
|
||||
// language/redef-same-prefixtable-idx.zeek btest, treat
|
||||
// this as += rather than =, and with the initializer
|
||||
// implicitly inside a list.
|
||||
init = make_intrusive<ListExpr>(init);
|
||||
c = INIT_EXTRA;
|
||||
init->Error("Initialization not preceded by =/+=/-= is not allowed.");
|
||||
}
|
||||
|
||||
if ( init && init->Tag() == EXPR_LIST )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue