zeek/testing/btest/language/optional-and-default-field.zeek
Arne Welzel 473723cc47 Attr: Deprecate using &default and &optional together on record fields
If &default implies re-initialization of the field, using them together
doesn't make much sense.
2025-07-30 10:26:06 +02:00

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;