visitStructuralTypeExpr method

  1. @override
Uint8List visitStructuralTypeExpr(
  1. StructuralTypeExpr expr
)
override

Implementation

@override
Uint8List visitStructuralTypeExpr(StructuralTypeExpr expr) {
  final bytesBuilder = BytesBuilder();
  if (expr.isLocal) {
    bytesBuilder.addByte(HTOpCode.local);
  }
  bytesBuilder.addByte(HTValueTypeCode.structuralType);
  bytesBuilder
      .add(_uint16(expr.fieldTypes.length)); // uint8: length of param types
  for (final field in expr.fieldTypes) {
    final bytes = visitFieldTypeExpr(field);
    bytesBuilder.add(bytes);
  }
  return bytesBuilder.toBytes();
}