test: cover chained TEXT field checks

This commit is contained in:
Hermes Agent
2026-09-06 20:14:33 +00:00
parent d3fcce0221
commit a9abf80fbc
4 changed files with 27 additions and 1 deletions
+16
View File
@@ -89,6 +89,22 @@ Type mismatch for field backup.score: expected NUMBER, but this value looks like
This remains limited to direct assignments through simple alias chains; control-flow and complex object-flow analysis are still planned.
`CHECK TYPE` also preserves TEXT field metadata through the same chained aliases:
```claro
CLASS Player
HAS name TEXT
END
NEW Player player
SET alias player
SET backup alias
SET player.name "Ada"
CHECK TYPE backup.name IS TEXT
```
This confirms the declared field type without requiring the learner to repeat the original object variable name. The broader limits are unchanged: aliases created through branches, loops, or complex expressions are still planned.
`CHECK TYPE` also follows simple aliases for direct field metadata checks. This includes a second alias, so learners can give an object a more descriptive local name without losing the class field information:
```claro