test: cover AS TO object field annotations

This commit is contained in:
Hermes Agent
2026-09-21 01:16:13 +00:00
parent 9622f99fb1
commit 3eebd6a2b8
6 changed files with 24 additions and 1 deletions
+8
View File
@@ -817,6 +817,14 @@ NEW Player player
SET player.name TEXT "Ada"
```
The compatibility-shaped `AS ... TO` form is also accepted when it is clearer to separate the annotation from the value:
```claro
SET player.score AS NUMBER TO 10
```
Both explicit forms must agree with the class field declaration.
The explicit `TEXT` annotation must agree with the class field declaration. This
keeps typed field examples consistent with typed variable assignments while
still allowing the shorter `SET player.name "Ada"` form.