const Symbol sym = insert_symbol("@slice");
const Exp e = range->range->start ?: range->range->end;
struct Op_Import opi = { .op=sym, .lhs=e->info->type, .rhs=range->base->info->type,
- .pos=e->pos, .data=(uintptr_t)range->base, .op_type=op_exp };
+ .pos=e->pos, .data=(uintptr_t)exp_self(range), .op_type=op_exp };
CHECK_OB(op_emit(emit, &opi))
return GW_OK;
}
static OP_CHECK(opck_array_slice) {
const Exp e = (Exp)data;
- return e->info->type;
+ exp_setmeta(exp_self(e), 1);
+ return e->d.exp_slice.base->info->type;
}
static inline m_bool bounds(const M_Vector v, const m_int i) {
GWI_BB(gwi_oper_ini(gwi, "@Array", "@Array", NULL))
GWI_BB(gwi_oper_add(gwi, opck_array_at))
GWI_BB(gwi_oper_end(gwi, "@=>", ObjectAssign))
+ GWI_BB(gwi_oper_ini(gwi, "@null", "@Array", NULL))
+ GWI_BB(gwi_oper_add(gwi, opck_array_at))
+ GWI_BB(gwi_oper_end(gwi, "@=>", ObjectAssign))
GWI_BB(gwi_oper_ini(gwi, "nonnull @Array", (m_str)OP_ANY_TYPE, NULL))
GWI_BB(gwi_oper_add(gwi, opck_array_shift))
GWI_BB(gwi_oper_emi(gwi, opem_array_shift))
const Symbol sym = insert_symbol("@slice");
const Exp e = range->range->start ?: range->range->end;
struct Op_Import opi = { .op=sym, .lhs=e->info->type, .rhs=range->base->info->type,
- .pos=e->pos, .data=(uintptr_t)range->base, .op_type=op_exp };
+ .pos=e->pos, .data=(uintptr_t)exp_self(range), .op_type=op_exp };
return op_check(env, &opi);
}