ANN Type find_common_anc(const Type, const Type) __attribute__((pure));
ANN Type typedef_base(Type) __attribute__((pure));
ANN Type array_base(Type) __attribute__((pure));
+ANN Symbol array_sym(const Env env, const Type src,
+ const m_uint depth);
+ANN static inline Type array_base_simple(Type t) {
+ return t->array_depth ? t->info->base_type : t;
+}
ANN m_bool type_ref(Type) __attribute__((pure));
ANN Type actual_type(const struct Gwion_ *gwion, const Type t);
ANN static inline m_uint env_push_type(const Env env, const Type type) {
const m_uint depth) {
if (src->array_depth == depth) return insert_symbol(src->name);
const m_uint total_depth = src->array_depth + depth;
- const Type t = array_base(src);
+ const Type t = array_base_simple(src);
size_t len = strlen(t->name);
char name[len + 2 * total_depth + 1];
strcpy(name, t->name);
memcpy((m_bit *)RETURN, MEM(SZ_INT * 2), acc_sz);
}
-ANN /*static */ Symbol array_sym(const Env env, const Type src,
- const m_uint depth);
#include "template.h"
static OP_CHECK(opck_array_scan) {
struct TemplateScan *ts = (struct TemplateScan *)data;
env_set_error(env);
return env->gwion->type[et_error];
}
- const Symbol sym = array_sym(env, array_base(base), base->array_depth + 1);
+ const Symbol sym = array_sym(env, array_base_simple(base), base->array_depth + 1);
const Type type = nspc_lookup_type1(base->info->value->from->owner, sym);
if (type) return type;
const Class_Def cdef = cpy_class_def(env->gwion->mp, c);