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

If &default implies re-initialization of the field, using them together doesn't make much sense.
18 lines
499 B
Text
18 lines
499 B
Text
# @TEST-DOC: Warn on record fields that have both, &optional and &default
|
|
#
|
|
# @TEST-EXEC: zeek -b %INPUT
|
|
# @TEST-EXEC: btest-diff .stdout
|
|
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff .stderr
|
|
|
|
type R: record { };
|
|
|
|
type X: record {
|
|
c: count &optional &default=5;
|
|
i: int &default=-5 &optional;
|
|
v: vector of string &optional &default=vector();
|
|
r0: R &optional &default=R();
|
|
r1: R &default=R() &optional;
|
|
};
|
|
|
|
global x = X();
|
|
print x;
|