mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00

There was some confusing behavior with &optional and locals, so this should get rid of that by making it an error. However, there is a case where function parameters are still allowed to have &optional - this is because there are checks for &default in parameters as well.
12 lines
282 B
Text
12 lines
282 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;
|
|
|
|
# TODO: Invalid on parameters
|
|
function f(a: int &optional)
|
|
{
|
|
# Invalid in locals
|
|
local b: int &optional;
|
|
}
|