Do not install private methods from parent to subclass.
The build was successful. Details

All methods defined in superclass can be access by $this and $parent construct. There is no need to copy private methods, as they cannot be access in $this context.
This commit is contained in:
Rafal Kupiec 2019-05-29 13:25:17 +02:00
parent 28e18bcb4b
commit 02471b4ccb
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 5 additions and 3 deletions

View File

@ -282,11 +282,13 @@ PH7_PRIVATE sxi32 PH7_ClassInherit(ph7_vm *pVm, ph7_class *pSub, ph7_class *pBas
} }
} }
/* Install the method */ /* Install the method */
if(pMeth->iProtection != PH7_CLASS_PROT_PRIVATE) {
rc = SyHashInsert(&pSub->hMethod, (const void *)pName->zString, pName->nByte, pMeth); rc = SyHashInsert(&pSub->hMethod, (const void *)pName->zString, pName->nByte, pMeth);
if(rc != SXRET_OK) { if(rc != SXRET_OK) {
return rc; return rc;
} }
} }
}
/* Mark first inherited class as direct subclass */ /* Mark first inherited class as direct subclass */
if(!pSub->pBase) { if(!pSub->pBase) {
pSub->pBase = pBase; pSub->pBase = pBase;