struct Implicit {
Exp e;
Type t;
- loc_t pos;
};
+
ANN m_bool add_op(const Gwion gwion, const struct Op_Import*);
ANN Type op_check(const Env, struct Op_Import*);
ANN struct Instr_* op_emit(const Emitter, const struct Op_Import*);
ANN static m_bool emit_implicit_cast(const Emitter emit,
const restrict Exp from, const restrict Type to) {
- const struct Implicit imp = { from, to, from->pos };
+ const struct Implicit imp = { .e=from, .t=to };
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, .pos=e->pos };
+ struct Implicit imp = { .e=e, .t=t };
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, .pos=e->pos };
+ struct Implicit imp = { .e=e, .t=t };
struct Op_Import opi = { .op=sym, .lhs=e->type,
.rhs=t, .data=(uintptr_t)&imp, .pos=e->pos };
CHECK_OB(op_check(env, &opi))