zeek/testing/btest/language/invalid-optional-attr.zeek
Evan Typanski 4445bc1daf Fix parameter attributes pretending to be records
Parameters relied on is_record for a couple of validations, but they are
not records and should not be treated as such. This way we can validate
&optional better.
2025-08-14 12:00:15 -04:00

12 lines
276 B
Text

# @TEST-EXEC-FAIL: zeek -b %INPUT >out 2>&1
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff out
# Invalid on globals
global a: int &optional;
# Invalid on parameters
function f(a: int &optional)
{
# Invalid in locals
local b: int &optional;
}