typecheck: diagnose missing return types

This commit is contained in:
Hermes Agent
2026-09-18 09:12:58 +00:00
parent da2bd5c2e8
commit 131211adef
6 changed files with 15 additions and 1 deletions
+6
View File
@@ -184,6 +184,12 @@ CHECK TYPE score IS NUMBER TEXT
CHECK TYPE score has extra text after type NUMBER. Keep only the expression, IS, and one type.
```
If `RETURNS` is present without a type, `claro typecheck` explains what is missing and shows a beginner-friendly repair:
```text
Function greet needs a return type after RETURNS. Add a type such as NUMBER.
```
`CHECK TYPE` names a real Claro type. If a type name is misspelled, the checker explains the allowed beginner types instead of reporting a confusing value mismatch:
```text