typecheck: diagnose missing TO in field annotations

This commit is contained in:
Hermes Agent
2026-09-21 15:47:01 +00:00
parent a4f748b142
commit b1eba07cf1
8 changed files with 19 additions and 4 deletions
+1 -1
View File
@@ -829,7 +829,7 @@ The compatibility-shaped `AS ... TO` form is also accepted when it is clearer to
SET player.score AS NUMBER TO 10
```
Both explicit forms must agree with the class field declaration.
Both explicit forms must agree with the class field declaration. The separated form also needs `TO` before its value; `SET player.score AS NUMBER` reports `SET player.score needs TO after type NUMBER. Try: SET player.score AS NUMBER TO 10.`
Each explicit field annotation accepts one value expression only. Extra words are rejected
with a repair hint instead of being silently ignored: