test: cover compatibility method addition diagnostics

This commit is contained in:
Hermes Agent
2026-09-12 22:32:45 +00:00
parent bbf1ad0b19
commit 747e8156e0
7 changed files with 42 additions and 2 deletions
+20
View File
@@ -159,6 +159,26 @@ ENDCLASS
This matching `CALL player.score WITH 4` path is included in focused validation.
The same compatibility method return check explains an addition mistake instead of
falling back to a generic return error:
```claro
CLASS Player
TEACH total TAKES amount RETURNS NUMBER
CHECK TYPE amount IS NUMBER
RETURN amount + "oops"
LEARNED
ENDCLASS
```
`claro typecheck` reports:
```text
Type mismatch for return from Player.total: addition needs NUMBER values, but "oops" looks like TEXT.
```
This negative compatibility fixture is part of focused release validation.
Compatibility methods support numeric subtraction in the same focused way:
```claro