mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 10:38:20 +00:00
Unify type comparisions for records.
For records, same_type(r1, r2) would not check if the fields' attributes match as well. That seems like an oversight, and some callers of same_type() did indeed add that check on their end. This commit moves the check into same_type() itself. That generally doesn't seem make any differences except for a couple of places validating code, which we update a bit. That in turn leans to slightly different (better?) error messages for a couple of test cases.
This commit is contained in:
parent
a2577891e0
commit
d782c60f19
5 changed files with 45 additions and 52 deletions
|
@ -1690,6 +1690,9 @@ bool same_type(const Type& arg_t1, const Type& arg_t2,
|
|||
if ( (match_record_field_names && ! util::streq(td1->id, td2->id)) ||
|
||||
! same_type(td1->type, td2->type, is_init, match_record_field_names) )
|
||||
return false;
|
||||
|
||||
if ( ! same_attrs(td1->attrs.get(), td2->attrs.get()) )
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue