mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 14:08:20 +00:00

Previously, any expression that evaluates to a record may have been used in a record ctor's expression list. This didn't work in all cases, doesn't provide any unique functionality that can't be done otherwise, and is possibly a path to introducing subtle scripting errors. BIT-1192 #closed
16 lines
448 B
Text
16 lines
448 B
Text
# @TEST-EXEC-FAIL: bro -b %INPUT >out 2>&1
|
|
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff out
|
|
|
|
# Record ctor's expression list shouldn't accept "expressions that
|
|
# eval in to record". The expression list should only be comprised of
|
|
# record-field-assignment expressions.
|
|
|
|
type myrec: record {
|
|
cmd: string;
|
|
stdin: string &default="";
|
|
read_files: string &optional;
|
|
};
|
|
|
|
local bad = myrec([$cmd="echo hi"]);
|
|
|
|
print bad;
|