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
@@ -109,7 +109,7 @@ OBJECT CLASS player AS kind
OBJECT FIELDS player AS fields
```
Inside a method, an inline field type must agree with the class declaration. For example, `HAS score NUMBER` must not be assigned with `SET score TEXT 10`; `claro typecheck` explains the conflict and suggests `NUMBER`.
Inside a method, an inline field type must agree with the class declaration. For example, `HAS score NUMBER` must not be assigned with `SET score TEXT 10`; `claro typecheck` explains the conflict and suggests `NUMBER`. The same check applies to older `TEACH ... TAKES ...` / `LEARNED` methods, so compatibility lessons get the same feedback.
## Static type safety