mirror of
https://github.com/zeek/zeek.git
synced 2025-10-11 11:08: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
|
@ -504,6 +504,11 @@ public:
|
|||
ValPtr InitVal(const zeek::Type* t, ValPtr aggr) const override;
|
||||
bool IsPure() const override;
|
||||
|
||||
void SetOp2(ExprPtr e)
|
||||
{
|
||||
op2 = e;
|
||||
}
|
||||
|
||||
protected:
|
||||
bool TypeCheck(const AttributesPtr& attrs = nullptr);
|
||||
bool TypeCheckArithmetics(TypeTag bt1, TypeTag bt2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue