}
if (node->kind == Ast_Kind_Array_Literal && node->type_node == NULL) {
- i32 value_count = bh_arr_length(((AstArrayLiteral *) node)->values);
- node->type = type; // type_make_array(context.ast_alloc, type, value_count);
+ node->type = type;
node->flags |= Ast_Flag_Array_Literal_Typed;
add_entities_for_node(NULL, (AstNode *) node, NULL, NULL);
}
if (!type_is_structlike_strict(sl->type)) {
- onyx_report_error(sl->token->pos, "Type is not a constructable using a struct literal.");
+ onyx_report_error(sl->token->pos,
+ "'%s' is not a constructable using a struct literal.",
+ type_get_name(sl->type));
return Check_Error;
}
&& aof->expr->kind != Ast_Kind_Memres
&& aof->expr->kind != Ast_Kind_Local)
|| (aof->expr->flags & Ast_Flag_Cannot_Take_Addr) != 0) {
- onyx_report_error(aof->token->pos, "Cannot take the address of value.");
+ onyx_report_error(aof->token->pos, "Cannot take the address of something that is not an l-value.");
return Check_Error;
}