Fixed property access check

This commit is contained in:
Jaime Humberto Macias Bustamante
2025-06-12 14:50:31 -07:00
parent 43bd1001d2
commit 6ac8fc7fe5
+2
View File
@@ -1502,6 +1502,8 @@ class Parser {
}
switch([get, set]) {
case [AGet, ASet] | [AGet, ANever] | [ANever, ASet]:
if(isVar && (expr == null && type == null))
error(ECustom('Property requires type-hint or initialization'), p1, pmax(expr));
if(expr != null && !isVar)
error(ECustom("Attempt to assign on field that is not a real variable"), p1, pmax(expr));
else if(type == null && !isVar)