typecheck: explain text subtraction operands

This commit is contained in:
Hermes Agent
2026-09-07 16:44:18 +00:00
parent f88b27ae8c
commit 2e3b1c725f
5 changed files with 7 additions and 6 deletions
+2 -2
View File
@@ -231,10 +231,10 @@ Type mismatch for field alias.score: expected NUMBER, but this value looks like
The same check follows simple arithmetic and text-concatenation expressions. For example, `SET player.score player.name + 1` reports that the value looks like `TEXT`, rather than silently accepting an expression whose result cannot fit the `NUMBER` field.
The checker also identifies text operands in other arithmetic expressions. For example, `SET player.score player.score - player.name` reports the text result instead of silently treating an invalid numeric subtraction as unknown:
The checker also identifies text operands in other arithmetic expressions. For example, `SET player.score player.score - player.name` now explains the operator rule and names the operand, rather than silently treating an invalid numeric subtraction as unknown:
```text
Type mismatch for field player.score: expected NUMBER, but this value looks like TEXT.
Type mismatch for field player.score: subtraction needs NUMBER values, but player.name looks like TEXT.
```
TEXT-valued and YESNO-valued field-name mistakes are validated too: