mirror of
https://github.com/odin-lang/Odin.git
synced 2026-03-04 07:37:04 +00:00
Add struct #no_copy
This commit is contained in:
@@ -131,6 +131,14 @@ gb_internal void check_init_variables(CheckerContext *ctx, Entity **lhs, isize l
|
||||
if (d != nullptr) {
|
||||
d->init_expr = o->expr;
|
||||
}
|
||||
|
||||
if (o->type && is_type_no_copy(o->type)) {
|
||||
begin_error_block();
|
||||
if (check_no_copy_assignment(*o, str_lit("initialization"))) {
|
||||
error_line("\tInitialization of a #no_copy type must be either implicitly zero, a constant literal, or from a return value a call expression");
|
||||
}
|
||||
end_error_block();
|
||||
}
|
||||
}
|
||||
if (rhs_count > 0 && lhs_count != rhs_count) {
|
||||
error(lhs[0]->token, "Assignment count mismatch '%td' = '%td'", lhs_count, rhs_count);
|
||||
|
||||
Reference in New Issue
Block a user