OP_CHECK(opck_rassign);
OP_CHECK(opck_rhs_emit_var);
OP_CHECK(opck_basic_cast);
+OP_CHECK(opck_simple_cast);
OP_CHECK(opck_usr_implicit);
OP_CHECK(opck_new);
-OP_EMIT(opem_basic_cast);
OP_EMIT(opem_new);
#endif
GWI_BB(gwi_oper_end(gwi, "<<", NULL))
GWI_BB(gwi_oper_ini(gwi, "@Array", "@Array", NULL))
GWI_BB(gwi_oper_add(gwi, opck_array_cast))
- GWI_BB(gwi_oper_emi(gwi, opem_basic_cast))
GWI_BB(gwi_oper_end(gwi, "$", NULL))
GWI_BB(gwi_oper_ini(gwi, "nonnull @Array", "int", "int"))
-// GWI_BB(gwi_oper_ini(gwi, "@Array", "int", "int"))
GWI_BB(gwi_oper_add(gwi, opck_array_slice))
GWI_BB(gwi_oper_emi(gwi, opem_array_slice))
GWI_BB(gwi_oper_end(gwi, "@slice", NULL))
}
static OP_EMIT(opem_fptr_cast) {
- CHECK_OO(opem_basic_cast(emit, data))
Exp_Cast* cast = (Exp_Cast*)data;
if(exp_self(cast)->info->type->e->d.func->def->base->tmpl)
fptr_instr(emit, cast->exp->info->type->e->d.func, 1);
exp_self(cast)->info->type : env->gwion->type[et_null];
}
+OP_CHECK(opck_simple_cast) {
+ const Exp_Cast* cast = (Exp_Cast*)data;
+ return cast->exp->info->cast_to = exp_self(cast)->info->type;
+}
+
OP_CHECK(opck_usr_implicit) {
struct Implicit* imp = (struct Implicit*)data;
imp->e->info->cast_to = imp->t;
return imp->t;
}
-OP_EMIT(opem_basic_cast) {
- return (Instr)GW_OK;
-}
-
OP_CHECK(opck_const_rhs) {
const Exp_Binary* bin = (Exp_Binary*)data;
const m_str access = exp_access(bin->rhs);
CHECK_IF("-=>", rassign, r_minus)
CHECK_IF("*=>", rassign, r_mul)
CHECK_IF("/=>", rassign, r_div)
- _CHECK_OP("$", basic_cast, CastI2F)
+ _CHECK_OP("$", simple_cast, CastI2F)
_CHECK_OP("@implicit", implicit_i2f, CastI2F)
return GW_OK;
}
CHECK_FI("-=>", rassign, r_minus)
CHECK_FI("*=>", rassign, r_mul)
CHECK_FI("/=>", rassign, r_div)
- _CHECK_OP("$", basic_cast, CastF2I)
+ _CHECK_OP("$", simple_cast, CastF2I)
_CHECK_OP("@implicit", implicit_f2i, CastF2I)
return GW_OK;
}