for (auto &field : item.get_fields ())
{
auto name = field.get_field_name ().as_string ();
- auto expr = default_call (field.get_field_type ().clone_type ());
+ auto type = Builder::new_type (field.get_field_type ());
+ auto expr = default_call (std::move (type));
cloned_fields.emplace_back (
builder.struct_expr_field (std::move (name), std::move (expr)));
for (auto &field : tuple_item.get_fields ())
{
- auto type = field.get_field_type ().clone_type ();
+ auto type = Builder::new_type (field.get_field_type ());
defaulted_fields.emplace_back (default_call (std::move (type)));
}
auto types = std::vector<std::unique_ptr<Type>> ();
for (auto &field : item.get_fields ())
- types.emplace_back (field.get_field_type ().clone_type ());
+ {
+ auto type = Builder::new_type (field.get_field_type ());
+ types.emplace_back (std::move (type));
+ }
expanded = eq_impls (assert_receiver_is_total_eq_fn (std::move (types)),
item.get_identifier ().as_string (),
auto types = std::vector<std::unique_ptr<Type>> ();
for (auto &field : item.get_fields ())
- types.emplace_back (field.get_field_type ().clone_type ());
+ {
+ auto type = Builder::new_type (field.get_field_type ());
+ types.emplace_back (std::move (type));
+ }
expanded = eq_impls (assert_receiver_is_total_eq_fn (std::move (types)),
item.get_identifier ().as_string (),
auto &tuple = static_cast<EnumItemTuple &> (*variant);
for (auto &field : tuple.get_tuple_fields ())
- types.emplace_back (field.get_field_type ().clone_type ());
-
+ {
+ auto type = Builder::new_type (field.get_field_type ());
+ types.emplace_back (std::move (type));
+ }
break;
}
case EnumItem::Kind::Struct: {
auto &tuple = static_cast<EnumItemStruct &> (*variant);
for (auto &field : tuple.get_struct_fields ())
- types.emplace_back (field.get_field_type ().clone_type ());
+ {
+ auto type = Builder::new_type (field.get_field_type ());
+ types.emplace_back (std::move (type));
+ }
break;
}
auto types = std::vector<std::unique_ptr<Type>> ();
for (auto &field : item.get_variants ())
- types.emplace_back (field.get_field_type ().clone_type ());
+ {
+ auto type = Builder::new_type (field.get_field_type ());
+ types.emplace_back (std::move (type));
+ }
expanded = eq_impls (assert_receiver_is_total_eq_fn (std::move (types)),
item.get_identifier ().as_string (),