test: cover compatibility inline field annotations

This commit is contained in:
Hermes Agent
2026-09-15 12:38:49 +00:00
parent 0a31646f5d
commit 88c684da37
7 changed files with 32 additions and 2 deletions
+1 -1
View File
@@ -68,7 +68,7 @@ Still needed:
- type checking through branches and loops
- richer object field type checking beyond simple direct assignments
- typed imports/modules
- inline method-field annotations must agree with the class `HAS` declaration; conflicting annotations now get a repair-oriented diagnostic even when the value's inferred type is otherwise correct.
- inline method-field annotations must agree with the class `HAS` declaration in both modern `TEACH` / `END` and compatibility `TAKES` / `LEARNED` methods; conflicting annotations now get a repair-oriented diagnostic even when the value's inferred type is otherwise correct.
Good starting docs:
- `ADVANCED_STATIC_TYPING.md`
+1
View File
@@ -49,6 +49,7 @@ Keep declared return types honest: `claro typecheck` now reports friendly diagno
8b. Keep compatibility method-body text expressions aligned: `TAKES` / `LEARNED` methods now have positive TEXT concatenation coverage in both operand orders beside the modern `TEACH` / `END` examples.
8c. Keep explicit method-field annotations aligned with class declarations: `SET score TEXT "oops"` inside a method with `HAS score NUMBER` now reports the declared field mismatch instead of accepting the inline annotation; broader annotation consistency remains planned.
8d. Keep inline method-field annotations consistent with `HAS` declarations: `claro typecheck` now rejects a conflicting annotation even when the assigned value itself has the class-declared type, and explains which type to use.
8e. Keep inline method-field annotation coverage aligned across syntax generations: compatibility `TAKES` / `LEARNED` methods now have matching positive and negative fixtures, so older lessons retain the same class-declared-type guidance.
### 1. Strong static types