Implement cooperative parent calls across runtime C3 MRO and enforce lifecycle method rules
Build / AerScript (push) Successful in 41s

This commit is contained in:
2026-10-24 19:20:52 +02:00
parent d511414453
commit c6e7151e72
3 changed files with 96 additions and 50 deletions
+6
View File
@@ -3437,6 +3437,12 @@ static sxi32 PH7_GenStateCompileClassMethod(
/* Peek method name */
pName = &pGen->pIn->sData;
nLine = pGen->pIn->nLine;
if(((pName->nByte == sizeof("__construct") - 1 &&
SyMemcmp(pName->zString, "__construct", sizeof("__construct") - 1) == 0) ||
(pName->nByte == sizeof("__destruct") - 1 &&
SyMemcmp(pName->zString, "__destruct", sizeof("__destruct") - 1) == 0)) && nType != MEMOBJ_VOID) {
PH7_GenCompileError(pGen, E_ERROR, nLine, "Method '%z::%z()' must return void", &pClass->sName, pName);
}
/* Jump the method name */
pGen->pIn++;
if(iFlags & PH7_CLASS_ATTR_VIRTUAL) {