}
static inline m_bool push_func_code(const Emitter emit, const Func f) {
- if (!vector_size(&emit->code->instr)) return GW_OK;
+ if (!vector_size(&emit->code->instr)) {
+ if(fflag(f, fflag_tmpl)) {
+ // we are sporking a template
+ // assume static call for now
+ const Instr instr = emit_add_instr(emit, RegSetImm);
+ instr->m_val = (m_uint)f->code;
+ instr->m_val2 = (m_uint)-SZ_INT;
+ }
+ return GW_OK;
+ }
const Instr instr = (Instr)vector_back(&emit->code->instr);
if (instr->opcode == eDotTmplVal) {
size_t len = strlen(f->name);
push_func_code(emit, f);
else if (vector_size(&emit->code->instr)) {
const Instr back = (Instr)vector_back(&emit->code->instr);
- if ((f_instr)(m_uint)back->opcode == DotFunc) back->m_val = f->vt_index;
+ if (back->opcode == eDotFunc) back->m_val = f->vt_index;
}
if (vector_size(&emit->code->instr) && vflag(f->value_ref, vflag_member) &&
is_fptr(emit->gwion, f->value_ref->type)) {
print_current_args(args);
else
gw_err(_("and not:\n {G}void{0}\n"));
+ if (env->context) env->context->error = true;
}
ANN static m_uint get_type_number(Specialized_List list) {
t->flag |= cdef->flag;
// add_type(env, t->info->value->from->owner, t);
cdef_flag(cdef, t);
- if (cdef->base.ext && cdef->base.ext->array) set_tflag(t, tflag_typedef);
return t;
}