Make checking map key exists optional

This commit is contained in:
Ginger Bill
2017-02-06 21:31:27 +00:00
parent f11d73ffaa
commit df78b8ad3e
4 changed files with 25 additions and 12 deletions
+2 -5
View File
@@ -262,11 +262,8 @@ Type *check_assignment_variable(Checker *c, Operand *op_a, AstNode *lhs) {
return NULL;
case Addressing_Variable:
break;
case Addressing_MapIndex: {
Type *t = base_type(assignment_type); GB_ASSERT(is_type_tuple(t));
t = t->Tuple.variables[0]->type;
assignment_type = t;
} break;
case Addressing_MapIndex:
break;
default: {
if (op_b.expr->kind == AstNode_SelectorExpr) {
// NOTE(bill): Extra error checks