diff --git a/engine/compiler.c b/engine/compiler.c index 1ef8b6e..6fd990b 100644 --- a/engine/compiler.c +++ b/engine/compiler.c @@ -3458,7 +3458,7 @@ static sxi32 PH7_GenStateCompileClassMethod( /* Only method signature is allowed */ if(pGen->pIn < pGen->pEnd && (pGen->pIn->nType & PH7_TK_SEMI /* ';'*/) == 0) { PH7_GenCompileError(pGen, E_ERROR, pGen->pIn->nLine, - "Interface method '%z::%z()' cannot contain body", &pClass->sName, pName); + "Interface or virtual method '%z::%z()' cannot contain body", &pClass->sName, pName); } } /* Store method return data type */ diff --git a/engine/oop.c b/engine/oop.c index 444d2f9..51a6645 100644 --- a/engine/oop.c +++ b/engine/oop.c @@ -282,7 +282,7 @@ PH7_PRIVATE sxi32 PH7_ClassInherit(ph7_vm *pVm, ph7_class *pSub, ph7_class *pBas } else { if(pMeth->iFlags & PH7_CLASS_ATTR_VIRTUAL) { /* Virtual method must be defined in the child class */ - PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, "Virtual method '%z:%z()' must be defined inside child class '%z'", &pBase->sName, pName, &pSub->sName); + PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, "Virtual method '%z::%z()' must be defined inside child class '%z'", &pBase->sName, pName, &pSub->sName); } } /* Install the method */ diff --git a/engine/vm.c b/engine/vm.c index 0bb1574..91439be 100644 --- a/engine/vm.c +++ b/engine/vm.c @@ -4331,7 +4331,7 @@ static sxi32 VmByteCodeExec( } PH7_MemObjRelease(pTos); } else if((pMeth->iFlags & PH7_CLASS_ATTR_STATIC) == 0 && ((pClass->iFlags & PH7_CLASS_FINAL) == 0 || (pClass->iFlags & PH7_CLASS_VIRTUAL) == 0)) { - PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, "Attempt to call statically a non-static method '%z::%z()'", + PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, "An object reference is required for the non-static method '%z::%z()'", &pClass->sName, &sName); } else if(!VmClassMemberAccess(&(*pVm), pClass, pMeth->iProtection)) { PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, "Method '%z::%z()' is inaccessible due to its protection level", @@ -4364,7 +4364,7 @@ static sxi32 VmByteCodeExec( if(pAttr) { if((pAttr->iFlags & (PH7_CLASS_ATTR_STATIC | PH7_CLASS_ATTR_CONSTANT)) == 0) { /* Access to a non static attribute */ - PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, "Access to a non-static class attribute '%z::$%z'", + PH7_VmThrowError(&(*pVm), PH7_CTX_ERR, "An object reference is required for the non-static attribute '%z::$%z'", &pClass->sName, &pAttr->sName ); } else {