typecheck: reject extra AS TO field tokens

This commit is contained in:
Hermes Agent
2026-09-21 07:27:18 +00:00
parent aae8eb7608
commit 72a5589a3e
7 changed files with 29 additions and 1 deletions
+11
View File
@@ -825,6 +825,17 @@ SET player.score AS NUMBER TO 10
Both explicit forms must agree with the class field declaration.
The separated form accepts one value expression only. Extra words are rejected
with a repair hint instead of being silently ignored:
```claro
SET player.score AS NUMBER TO 10 extra
```
```text
SET player.score has extra text after value 10. Keep only the field name, type, TO, and one expression.
```
The `AS ... TO` spelling also works inside modern and compatibility object methods:
```claro