mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-17 00:11:25 -07:00
Semicolons mandatory again (and probably forever now...)
This commit is contained in:
+11
-6
@@ -991,17 +991,22 @@ void init_preload(Checker *c) {
|
||||
}
|
||||
|
||||
if (t_type_info == NULL) {
|
||||
Entity *e = current_scope_lookup_entity(c->global_scope, str_lit("Type_Info"));
|
||||
if (e == NULL) {
|
||||
Entity *type_info_entity = current_scope_lookup_entity(c->global_scope, str_lit("Type_Info"));
|
||||
if (type_info_entity == NULL) {
|
||||
compiler_error("Could not find type declaration for `Type_Info`\n"
|
||||
"Is `runtime.odin` missing from the `core` directory relative to odin.exe?");
|
||||
}
|
||||
t_type_info = e->type;
|
||||
Entity *type_info_member_entity = current_scope_lookup_entity(c->global_scope, str_lit("Type_Info_Member"));
|
||||
if (type_info_entity == NULL) {
|
||||
compiler_error("Could not find type declaration for `Type_Info_Member`\n"
|
||||
"Is `runtime.odin` missing from the `core` directory relative to odin.exe?");
|
||||
}
|
||||
t_type_info = type_info_entity->type;
|
||||
t_type_info_ptr = make_type_pointer(c->allocator, t_type_info);
|
||||
GB_ASSERT(is_type_union(e->type));
|
||||
TypeRecord *record = &base_type(e->type)->Record;
|
||||
GB_ASSERT(is_type_union(type_info_entity->type));
|
||||
TypeRecord *record = &base_type(type_info_entity->type)->Record;
|
||||
|
||||
t_type_info_member = record->other_fields[0]->type;
|
||||
t_type_info_member = type_info_member_entity->type;
|
||||
t_type_info_member_ptr = make_type_pointer(c->allocator, t_type_info_member);
|
||||
|
||||
if (record->field_count != 18) {
|
||||
|
||||
+6
-3
@@ -372,10 +372,13 @@ void check_stmt_internal(Checker *c, AstNode *node, u32 flags) {
|
||||
|
||||
Operand operand = {Addressing_Invalid};
|
||||
check_expr(c, &operand, ids->expr);
|
||||
if (operand.mode == Addressing_Invalid)
|
||||
if (operand.mode == Addressing_Invalid) {
|
||||
return;
|
||||
if (!is_type_numeric(operand.type)) {
|
||||
error(ids->op, "Non numeric type");
|
||||
}
|
||||
if (!is_type_numeric(operand.type) && !is_type_pointer(operand.type)) {
|
||||
gbString type_str = type_to_string(operand.type);
|
||||
error(ids->op, "Non numeric type `%s`", type_str);
|
||||
gb_string_free(type_str);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user