typecheck: reject extra AS TO field tokens
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user