typecheck: validate CALL object method args

This commit is contained in:
Hermes Agent
2026-09-01 19:32:22 +00:00
parent 6edbd587bc
commit 8237792cc3
6 changed files with 30 additions and 3 deletions
+2 -1
View File
@@ -159,7 +159,7 @@ END
CALL label WITH 7, "old"
```
The same narrow diagnostic foundation now covers simple object method calls when the object was created with `NEW` and the method body uses `CHECK TYPE` for a parameter. Correct calls such as `DO player.add 5` are covered by validation, and wrong-type calls get a focused learner-facing error:
The same narrow diagnostic foundation now covers simple object method calls when the object was created with `NEW` and the method body uses `CHECK TYPE` for a parameter. Correct calls such as `DO player.add 5` and compatibility calls such as `CALL player.add WITH 5` are covered by validation, and wrong-type calls get a focused learner-facing error:
```claro
CLASS Player
@@ -173,6 +173,7 @@ END
NEW Player player
DO player.add "five"
CALL player.add WITH "five"
```
```text