} else {
fori (i, 0, store_expr_count) {
+ if (right_type->Compound.types[i] == &basic_types[Basic_Kind_Void]) {
+ ERROR(lhs->exprs[i]->token->pos, "Due to inference, this variables type would be 'void', which is not allowed.");
+ }
+
TRY_ASSIGN_TYPE_OR_FAIL(&lhs->exprs[i], right_type->Compound.types[i], binop->token);
}
if (param->vararg_kind != VA_Kind_Not_VA) has_had_varargs = 1;
if (local->type->kind != Type_Kind_Array && type_size_of(local->type) == 0) {
- ERROR(local->token->pos, "Function parameters cannot have zero-width types.");
+ ERROR(local->token->pos, "Function parameters cannot have 'void' as their type.");
}
}
else if (is_basic && (type->Basic.flags & Basic_Flag_SIMD)) {
instr = WI_V128_LOAD;
}
+ else if (is_basic && (type->Basic.kind == Basic_Kind_Void)) {
+ // Do nothing to "load" a void type.
+ return;
+ }
WID(NULL, instr, ((WasmInstructionData) { alignment, offset }));