diff --git a/engine/oop.c b/engine/oop.c index 4f1c381..2480dfe 100644 --- a/engine/oop.c +++ b/engine/oop.c @@ -282,9 +282,11 @@ PH7_PRIVATE sxi32 PH7_ClassInherit(ph7_vm *pVm, ph7_class *pSub, ph7_class *pBas } } /* Install the method */ - rc = SyHashInsert(&pSub->hMethod, (const void *)pName->zString, pName->nByte, pMeth); - if(rc != SXRET_OK) { - return rc; + if(pMeth->iProtection != PH7_CLASS_PROT_PRIVATE) { + rc = SyHashInsert(&pSub->hMethod, (const void *)pName->zString, pName->nByte, pMeth); + if(rc != SXRET_OK) { + return rc; + } } } /* Mark first inherited class as direct subclass */