const m_bool base_static = is_class(env->gwion, member->t_base);
const Type the_base = base_static ? member->t_base->e->d.base_type : member->t_base;
if(!the_base->nspc)
- ERR_O(member->base->pos,
+ ERR_N(member->base->pos,
_("type '%s' does not have members - invalid use in dot expression of %s"),
the_base->name, str)
if(member->xid == insert_symbol(env->gwion->st, "this") && base_static)
- ERR_O(exp_self(member)->pos,
+ ERR_N(exp_self(member)->pos,
_("keyword 'this' must be associated with object instance..."))
const Value value = find_value(the_base, member->xid);
if(!value) {
_("class '%s' has no member '%s'"), the_base->name, str);
if(member->t_base->nspc)
did_you_mean_type(the_base, str);
- return NULL;
+ return env->gwion->type[et_null];
}
- CHECK_BO(not_from_owner_class(env, the_base, value, exp_self(member)->pos))
+ CHECK_BN(not_from_owner_class(env, the_base, value, exp_self(member)->pos))
if(!env->class_def || isa(env->class_def, value->from->owner_class) < 0) {
if(GET_FLAG(value, private))
- ERR_O(exp_self(member)->pos,
+ ERR_N(exp_self(member)->pos,
_("can't access private '%s' outside of class..."), value->name)
else if(GET_FLAG(value, protect))
exp_setprot(exp_self(member), 1);
}
if(base_static && GET_FLAG(value, member))
- ERR_O(exp_self(member)->pos,
+ ERR_N(exp_self(member)->pos,
_("cannot access member '%s.%s' without object instance..."),
the_base->name, str)
if(GET_FLAG(value, const))
struct scope_iter iter = { nspc->info->value, 0, 0 };
Value value;
while(scope_iter(&iter, &value) > 0) {
- if(!strcmp(name, value->name))
+ if(vector_find(v, (vtype)value->name) > 0 &&!strcmp(name, value->name))
continue;
if(wagner_fisher(name, value->name))
vector_add(v, (vtype)value->name);
while((t = t->e->parent) && t->nspc);
for(m_uint i = 0; i < vector_size(&v); ++i)
gw_err(_(" (did you mean '%s'?)\n"), (m_str)vector_at(&v, i));
- did_you_mean_nspc(type->nspc, name);
vector_release(&v);
}