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
This commit is contained in:
Rafal Kupiec 2018-07-28 11:53:56 +02:00
parent deabbd5554
commit 8ab80ff8bc
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 5 additions and 2 deletions

View File

@ -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;
}