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

with the field. This works now: type X: record { a: table[string] of bool &default=table( ["foo"] = T ); b: table[string] of bool &default=table(); c: set[string] &default=set("A", "B", "C"); d: set[string] &default=set(); }; I think previously the intend was to associate &default with the table/set (i.e., define the default value for non-existing indices). However, that was already not working: the error checking was reporting type mismatches. So, this shouldn't break anything and make things more consistent.
19 lines
390 B
Text
19 lines
390 B
Text
|
|
# @TEST-EXEC: bro %INPUT >output 2>&1
|
|
# @TEST-EXEC: btest-diff output
|
|
|
|
type X: record {
|
|
a: table[string] of bool &default=table( ["foo"] = T );
|
|
b: table[string] of bool &default=table();
|
|
c: set[string] &default=set("A", "B", "C");
|
|
d: set[string] &default=set();
|
|
};
|
|
|
|
global x: X;
|
|
global y: table[string] of bool &default=T;
|
|
|
|
print x$a;
|
|
print x$b;
|
|
print x$c;
|
|
print x$d;
|
|
|