typecheck: diagnose missing TYPE OF result names

This commit is contained in:
Hermes Agent
2026-09-19 20:19:12 +00:00
parent cdb5b75c62
commit 7d081f346c
6 changed files with 19 additions and 1 deletions
+12
View File
@@ -16,6 +16,18 @@ TYPE OF needs an expression before AS. Try: TYPE OF score AS kind.
Add the value whose type should be stored, such as `TYPE OF score AS kind`.
If the result name is missing after `AS`, `claro typecheck` names the missing piece and shows the complete beginner form:
```claro
TYPE OF score AS
```
```text
TYPE OF needs a result name after AS. Try: TYPE OF score AS kind.
```
Add a result name after `AS`, such as `kind`.
Class fields need a type after the field name. If a learner writes `HAS score` instead of `HAS score NUMBER`, `claro typecheck` explains the missing piece:
```text