typecheck: accept nested map values in lists

This commit is contained in:
Hermes Agent
2026-09-06 03:49:45 +00:00
parent 3d372988f4
commit cb061886e3
7 changed files with 26 additions and 3 deletions
+13
View File
@@ -43,6 +43,19 @@ Output:
Type mismatch for map scores: expected NUMBER value, but this value looks like TEXT.
```
## Nested container values
A typed list can contain a typed map. `claro typecheck` keeps the map's own type metadata while checking the outer list:
```claro
SET people AS LIST OF MAP TO LIST
SET person AS MAP OF TEXT TO MAP
PUT person KEY "name" VALUE "Ada"
ADD person TO people
```
This is accepted with `Type check OK`. More complex nested container operations and full key/value inference remain future work.
## Function parameter checks
Claro now has a small static-checking foundation for function arguments. Keep the beginner-friendly function syntax, then put the expected type inside the function with `CHECK TYPE`: