test: cover typed method return expressions

This commit is contained in:
Hermes Agent
2026-09-09 05:50:44 +00:00
parent 57246c7a47
commit 465f3f4d26
8 changed files with 24 additions and 4 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ See `CURRENT_STATUS.md` for the detailed feature matrix.
4. Add small examples for each foundation feature before adding bigger syntax. The object-field foundation now includes positive and negative validation for field expressions such as `SET player.score player.name`, `SET player.score player.score + 1`, `SET player.name player.score + 1`, explicitly typed field assignments, explicit typed assignments to undeclared fields, simple and chained aliases such as `SET alias player`, `SET backup alias`, followed by `SET backup.score ...` or `CHECK TYPE backup.score IS ...`, chained aliases in object-method calls through both modern `DO` and compatibility `CALL ... WITH` forms (including a dedicated positive modern `DO` fixture), and arithmetic/text expression mismatches; typed containers also accept a map with nested type metadata when it is added to a `LIST OF MAP`; broader alias/control-flow checking remains planned.
5. Keep the focused typecheck validator complete: every `typecheck_*.claro` fixture, including positive fixtures, must be exercised by release validation.
6. Continue narrowing expression diagnostics: known TEXT operands now remain visible through arithmetic, with focused numeric-subtraction, numeric-division, and numeric-multiplication positives plus text-operand addition, subtraction, multiplication, and division coverage. Text concatenation into TEXT fields is covered in both operand orders, including field-to-field concatenation. Each numeric operator gives specific guidance naming the text operand. `CHECK TYPE` also rejects misspelled expected type names before comparing values.
7. Keep declared return types honest: `claro typecheck` now reports friendly diagnostics for mismatched return expressions and missing `RETURN` statements when a simple function or object method declares `RETURNS TYPE`; `CHECK TYPE` parameter metadata also informs arithmetic return-expression checking. Focused fixtures cover both forms. Branch-sensitive return analysis remains planned.
7. Keep declared return types honest: `claro typecheck` now reports friendly diagnostics for mismatched return expressions and missing `RETURN` statements when a simple function or object method declares `RETURNS TYPE`; `CHECK TYPE` parameter metadata also informs arithmetic return-expression checking, including object methods. Focused fixtures cover both forms. Branch-sensitive return analysis remains planned.
## Complete-platform milestones