Browse Source

Several fixes to multiple inheritance

* Only first inherited class should be available via 'parent' keyword
 * If class X extends Y, Z and both Y and Z implements a(), $this->a() should match to the first one
pull/44/head
Rafal Kupiec 4 years ago
parent
commit
8ab80ff8bc
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
  1. 7
      engine/oop.c

7
engine/oop.c

@ -310,8 +310,11 @@ PH7_PRIVATE sxi32 PH7_ClassInherit(ph7_vm *pVm, ph7_class *pSub, ph7_class *pBas
}
}
}
/* Mark as subclass */
pSub->pBase = pBase;
/* Mark first inherited class as direct subclass */
ph7_class *pClass = pSub;
if(!pSub->pBase) {
pSub->pBase = pBase;
}
/* All done */
return SXRET_OK;
}

Loading…
Cancel
Save