directly construct records of known types, rather than requiring coercion

This commit is contained in:
Vern Paxson 2021-05-30 17:47:28 -07:00
parent d165db6909
commit 9a429808ab
6 changed files with 81 additions and 12 deletions

View file

@ -683,10 +683,8 @@ expr:
switch ( ctor_type->Tag() ) {
case TYPE_RECORD:
{
auto rce = make_intrusive<RecordConstructorExpr>(
ListExprPtr{AdoptRef{}, $4});
auto rt = cast_intrusive<RecordType>(ctor_type);
$$ = new RecordCoerceExpr(std::move(rce), std::move(rt));
$$ = new RecordConstructorExpr(rt, ListExprPtr{AdoptRef{}, $4});
}
break;