ANN static m_bool emit_implicit_cast(const Emitter emit,
const restrict Exp from, const restrict Type to) {
- const struct Implicit imp = { .e=from, .t=to };
+ const struct Implicit imp = { from, to, from->pos };
struct Op_Import opi = { .op=insert_symbol("@implicit"), .lhs=from->type, .rhs=to, .data=(m_uint)&imp };
return op_emit_bool(emit, &opi);
}
ANN static m_bool _check_implicit(const Env env, const m_str str,
const Exp e, const Type t) {
- struct Implicit imp = { .e=e, .t=t };
+ struct Implicit imp = { .e=e, .t=t, .pos=e->pos };
struct Op_Import opi = { .op=insert_symbol(str), .lhs=e->type,
.rhs=t, .data=(uintptr_t)&imp, .pos=e->pos };
CHECK_OB(op_check(env, &opi))
ANN static m_bool check_internal(const Env env, const Symbol sym,
const Exp e, const Type t) {
- struct Implicit imp = { .e=e, .t=t };
+ struct Implicit imp = { .e=e, .t=t, .pos=e->pos };
struct Op_Import opi = { .op=sym, .lhs=e->type,
.rhs=t, .data=(uintptr_t)&imp, .pos=e->pos };
CHECK_OB(op_check(env, &opi))