mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 00:28:21 +00:00
Deprecate RecordType::FieldType(), replace with GetFieldType()
This commit is contained in:
parent
455fc29b1a
commit
103fed9f01
13 changed files with 105 additions and 89 deletions
|
@ -2817,12 +2817,13 @@ IntrusivePtr<RecordVal> RecordVal::CoerceTo(const RecordType* t, Val* aggr, bool
|
|||
// Check for allowable optional fields is outside the loop, below.
|
||||
continue;
|
||||
|
||||
if ( ar_t->FieldType(t_i)->Tag() == TYPE_RECORD &&
|
||||
! same_type(ar_t->FieldType(t_i), v->Type()) )
|
||||
const auto& ft = ar_t->GetFieldType(t_i);
|
||||
|
||||
if ( ft->Tag() == TYPE_RECORD && ! same_type(ft.get(), v->Type()) )
|
||||
{
|
||||
auto rhs = make_intrusive<ConstExpr>(IntrusivePtr{NewRef{}, v});
|
||||
auto e = make_intrusive<RecordCoerceExpr>(std::move(rhs),
|
||||
IntrusivePtr{NewRef{}, ar_t->FieldType(t_i)->AsRecordType()});
|
||||
cast_intrusive<RecordType>(ft));
|
||||
ar->Assign(t_i, e->Eval(nullptr));
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue