struct AstNumLit { AstTyped_base; union { i32 i; i64 l; f32 f; f64 d; } value; };
struct AstStrLit { AstTyped_base; u64 addr; u64 length; };
struct AstLocal { AstTyped_base; };
-struct AstArgument { AstTyped_base; AstTyped *value; VarArgKind va_kind; b32 is_baked : 1; };
struct AstAddressOf { AstTyped_base; AstTyped *expr; };
struct AstDereference { AstTyped_base; AstTyped *expr; };
struct AstSizeOf { AstTyped_base; AstType *so_ast_type; Type *so_type; u64 size; };
struct AstAlignOf { AstTyped_base; AstType *ao_ast_type; Type *ao_type; u64 alignment; };
+struct AstArgument {
+ AstTyped_base;
+
+ AstTyped *value;
+
+ VarArgKind va_kind;
+ b32 is_baked : 1;
+ b32 pass_as_any : 1;
+};
struct AstSubscript {
AstTyped_base;
BinaryOp __unused_operation; // This will be set to Binary_Op_Subscript
if is_hot_item(hash) {
move_towards(^animation_state.hover_time, 1.0f, theme.hover_speed);
+
+ #if #defined(set_cursor) {
+ set_cursor(Cursors.Pointer);
+ }
} else {
move_towards(^animation_state.hover_time, 0.0f, theme.hover_speed);
}
retval = map.get_ptr(^animation_states, id);
}
- // printf("{*}\n", retval);
retval.accessed_this_frame = true;
return retval;
}
Type* node_type = get_expression_type(node);
if (types_are_compatible(node_type, type)) return 1;
+ i64 any_id = type_build_from_ast(context.ast_alloc, builtin_any_type)->id;
+ if (node_type && node_type->id != any_id && type->id == any_id) return 1;
+
// Here are some of the ways you can unify a node with a type if the type of the
// node does not match the given type:
//
return 0;
}
+ if (arg_arr[arg_pos]->value->type && arg_arr[arg_pos]->value->type->id != any_type_id && formal_params[arg_pos]->id == any_type_id) {
+ resolve_expression_type(arg_arr[arg_pos]->value);
+ arg_arr[arg_pos]->pass_as_any = 1;
+ }
+
arg_arr[arg_pos]->va_kind = VA_Kind_Not_VA;
break;
}
vararg_count += 1;
}
+ if (arg->pass_as_any) {
+ place_on_stack = 1;
+ }
+
if (place_on_stack) WIL(WI_LOCAL_GET, stack_top_store_local);
emit_expression(mod, &code, arg->value);
vararg_any_types[vararg_count - 1] = arg->value->type->id;
}
+ if (arg->pass_as_any) {
+ WIL(WI_I32_CONST, arg->value->type->id);
+ }
+
reserve_size += type_size_of(arg->value->type);
}
}