Add struct #no_copy

This commit is contained in:
gingerBill
2023-04-15 15:36:21 +01:00
parent b7b5043aea
commit 5da76ae34b
9 changed files with 61 additions and 12 deletions

View File

@@ -326,7 +326,6 @@ gb_internal bool check_is_terminating(Ast *node, String const &label) {
gb_internal Type *check_assignment_variable(CheckerContext *ctx, Operand *lhs, Operand *rhs) {
if (rhs->mode == Addressing_Invalid) {
return nullptr;
@@ -339,6 +338,8 @@ gb_internal Type *check_assignment_variable(CheckerContext *ctx, Operand *lhs, O
Ast *node = unparen_expr(lhs->expr);
check_no_copy_assignment(*rhs, str_lit("assignment"));
// NOTE(bill): Ignore assignments to '_'
if (is_blank_ident(node)) {
check_assignment(ctx, rhs, nullptr, str_lit("assignment to '_' identifier"));
@@ -400,6 +401,7 @@ gb_internal Type *check_assignment_variable(CheckerContext *ctx, Operand *lhs, O
}
Type *assignment_type = lhs->type;
switch (lhs->mode) {
case Addressing_Invalid:
return nullptr;