]> Nishi Git Mirror - gwion.git/commitdiff
:bug: better . checking
authorfennecdjay <fennecdjay@gmail.com>
Wed, 21 Dec 2022 10:45:19 +0000 (11:45 +0100)
committerfennecdjay <fennecdjay@gmail.com>
Wed, 21 Dec 2022 10:45:19 +0000 (11:45 +0100)
src/lib/object_op.c

index fab5f3ea6caaad66efafd3e4700cab35d4a3ea37..f2fcc5b409f9c99208a22baff958c43f7cc52f4a 100644 (file)
@@ -222,7 +222,8 @@ OP_CHECK(opck_object_dot) {
   }
   CHECK_BN(not_from_owner_class(env, the_base, value, self->pos));
   CHECK_BN(member_access(env, self, value));
-  if (base_static && vflag(value, vflag_member))
+  if ((base_static && vflag(value, vflag_member)) ||
+      (value->from->owner_class != env->class_def && isa(value->from->owner_class, env->class_def) > 0))
     ERR_N(self->pos,
           _("cannot access member '%s.%s' without object instance..."),
           the_base->name, str);
@@ -399,6 +400,7 @@ GWION_IMPORT(object_op) {
   GWI_BB(gwi_oper_end(gwi, "@unconditional", NULL))
   GWI_BB(gwi_oper_emi(gwi, opem_cond_object))
   GWI_BB(gwi_oper_end(gwi, "@conditional", NULL))
+  GWI_BB(gwi_oper_add(gwi, opck_unary_meta2))
   GWI_BB(gwi_oper_emi(gwi, opem_not_object))
   GWI_BB(gwi_oper_end(gwi, "!", NULL))
   GWI_BB(gwi_oper_ini(gwi, "@Compound", NULL, NULL))