CHECK_BB(emit_range(emit, range->range))
const Symbol sym = insert_symbol("@slice");
const Exp e = range->range->start ?: range->range->end;
- struct Op_Import opi = { .op=sym, .lhs=range->base->info->type, .rhs=e->info->type,
- .pos=e->pos, .data=(uintptr_t)exp_self(range), .op_type=op_exp };
+ 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 };
CHECK_OB(op_emit(emit, &opi))
return GW_OK;
}
static OP_CHECK(opck_array_slice) {
const Exp e = (Exp)data;
- return e->d.exp_slice.base->info->type;
+ return e->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_cast))
GWI_BB(gwi_oper_end(gwi, "$", NULL))
- GWI_BB(gwi_oper_ini(gwi, "nonnull @Array", "int", "int"))
+ GWI_BB(gwi_oper_ini(gwi, "int", "nonnull @Array", "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))
GWI_BB(gwi_item_end(gwi, ae_flag_const, NULL))
GWI_BB(gwi_class_end(gwi))
- GWI_BB(gwi_oper_ini(gwi, "string", "nonnull string", "string"))
+ GWI_BB(gwi_oper_ini(gwi, "string", "nonnull string", "nonnull string"))
GWI_BB(gwi_oper_add(gwi, opck_const_rhs))
GWI_BB(gwi_oper_end(gwi, "=>", String_Assign))
GWI_BB(gwi_oper_end(gwi, "==", String_eq))
GWI_BB(gwi_oper_end(gwi, "!=", String_neq))
- GWI_BB(gwi_oper_ini(gwi, "nonnull string", "int", "string"))
+ GWI_BB(gwi_oper_ini(gwi, "int", "nonnull string", "nonnull string"))
GWI_BB(gwi_oper_end(gwi, "@slice", StringSlice))
struct SpecialId_ spid = { .ck=check_funcpp, .exec=RegPushMe, .is_const=1 };
CHECK_BO(check_range(env, range->range))
const Symbol sym = insert_symbol("@slice");
const Exp e = range->range->start ?: range->range->end;
- struct Op_Import opi = { .op=sym, .lhs=range->base->info->type, .rhs=e->info->type,
- .pos=e->pos, .data=(uintptr_t)exp_self(range), .op_type=op_exp };
+ 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 };
return op_check(env, &opi);
}