test: cover compatibility method subtraction returns

This commit is contained in:
Hermes Agent
2026-09-12 16:21:24 +00:00
parent 7cdc2e72b1
commit 55e783e2c3
6 changed files with 31 additions and 3 deletions
+14 -1
View File
@@ -157,7 +157,20 @@ CLASS Player
ENDCLASS
```
The matching `CALL player.score WITH 4` path is included in focused validation.
This matching `CALL player.score WITH 4` path is included in focused validation.
Compatibility methods support numeric subtraction in the same focused way:
```claro
CLASS Player
TEACH score TAKES amount RETURNS NUMBER
CHECK TYPE amount IS NUMBER
RETURN amount - 2
LEARNED
ENDCLASS
```
The matching `CALL player.score WITH 4` success path is included in focused validation alongside the modern method subtraction case.
When a function declares a return type, `claro typecheck` accepts nested conditionals when every branch returns a value of that type: