exp_setvar(bin->rhs, 1);
return bin->rhs->type;
}
+
/*
static OP_CHECK(opck_fptr_cast) {
Exp_Cast * cast = (Exp_Cast *)data;
return impl->t;
}
+static OP_CHECK(opck_fptr_cast) {
+ Exp_Cast *cast = (Exp_Cast *)data;
+ const Type t = known_type(env, cast->td);
+ struct FptrInfo info = {cast->exp->type->info->func, t->info->func,
+ cast->exp, cast->td->pos};
+ CHECK_BN(fptr_do(env, &info));
+ return t;
+}
+
// smh the VM should be able to do that
static INSTR(Func2Code) {
*(VM_Code *)REG(-SZ_INT) = (*(Func *)REG(-SZ_INT))->code;
GWI_BB(gwi_oper_add(gwi, opck_fptr_impl))
GWI_BB(gwi_oper_emi(gwi, opem_fptr_impl))
GWI_BB(gwi_oper_end(gwi, "@implicit", NULL))
+ GWI_BB(gwi_oper_add(gwi, opck_fptr_cast))
+ GWI_BB(gwi_oper_end(gwi, "$", NULL))
GWI_BB(gwi_oper_ini(gwi, "@op", "@func_ptr", NULL))
GWI_BB(gwi_oper_add(gwi, opck_op_impl))
GWI_BB(gwi_oper_emi(gwi, opem_op_impl))