ANN2(1,3) ANEW Type new_type(MemPool, const m_uint xid, const m_str name, const Type);
ANEW ANN Type type_copy(MemPool, const Type type);
-ANN m_str get_type_name(const Env, const m_str, const m_uint);
+ANN m_str get_type_name(const Env, const Type t, const m_uint);
ANN Value find_value(const Type, const Symbol);
-//ANN Func find_func(const Type, const Symbol);
ANN m_bool isa(const Type, const Type) __attribute__((pure));
ANN m_bool isres(const Env, const Symbol, const loc_t pos);
ANN Type array_type(const Env, const Type, const m_uint);
return 0;
}
-ANN m_str get_type_name(const Env env, const m_str s, const m_uint index) {
+ANN m_str get_type_name(const Env env, const Type t, const m_uint index) {
+ const m_str s = t->name;
m_str name = strstr(s, "<");
m_uint i = 0;
m_uint lvl = 0;
do {
Type u = bin->rhs->info->type;
do {
- const m_str str = get_type_name(env, u->name, 1);
+ const m_str str = get_type_name(env, u, 1);
if(str && !strcmp(t->name, str))
return bin->lhs->info->type;
} while((u = u->e->parent));
static OP_CHECK(opck_ptr_deref) {
const Exp_Unary* unary = (Exp_Unary*)data;
- DECL_ON(const m_str, str, = get_type_name(env, unary->exp->info->type->name, 1))
+ DECL_ON(const m_str, str, = get_type_name(env, unary->exp->info->type, 1))
return exp_self(unary)->info->type = nspc_lookup_type1(env->curr, insert_symbol(str));
}
static OP_CHECK(opck_ptr_implicit) {
const struct Implicit* imp = (struct Implicit*)data;
const Exp e = imp->e;
- DECL_OO(const m_str, name, = get_type_name(env, imp->t->name, 1))
- if(!strcmp(get_type_name(env, imp->t->name, 1), e->info->type->name)) {
+ DECL_OO(const m_str, name, = get_type_name(env, imp->t, 1))
+ if(!strcmp(get_type_name(env, imp->t, 1), e->info->type->name)) {
const m_str access = exp_access(e);
if(access)
ERR_N(e->pos, _("can't cast %s value to Ptr"), access);