A statement beginning with '(' was rejected ("Expected statement"), so a
parenthesised cast could not be an assignment TARGET:
(a as TB).FX := 42; -> Parse error
Reading the same expression worked, and the hard-cast target TB(a).FX := 42
worked, so only this statement-parser entry point was missing.
ParseStmt now handles a leading '(' by parsing the parenthesised expression
and requiring a '.Field := Expr' suffix, building a TFieldAssignment whose
receiver is that expression (ObjExpr) — the same AST + semantic + codegen path
already used for element-field writes (a[i].F := v). No AST/semantic/codegen
change was needed; the gap was purely the parser.
Found by the e2e test-hardening sweep of the inheritance cluster. Regression:
TE2EMiscTests.TestRun_ParenCastAsAssignmentTarget, run on BOTH backends.
docs/grammar.ebnf FieldAssignment rule updated.
All three fixpoints + full suite (3223 tests) pass.
|
||
|---|---|---|
| .. | ||
| benchmark.txt | ||
| bif-format.adoc | ||
| design.adoc | ||
| extending-ast.adoc | ||
| future-improvements.adoc | ||
| grammar.ebnf | ||
| internal-linker-design.adoc | ||
| language-rationale.adoc | ||
| name-mangling.adoc | ||
| native-const-arg-arc-port.adoc | ||
| testing-strategy.adoc | ||