test: cover duplicate method parameters

This commit is contained in:
Hermes Agent
2026-09-15 23:20:00 +00:00
parent 04e3e567e0
commit aac07309e1
7 changed files with 42 additions and 2 deletions
+2
View File
@@ -177,6 +177,8 @@ If a function repeats a parameter name, `claro typecheck` reports the declaratio
Function greet declares parameter name more than once. Give each parameter a different name.
```
The same declaration check applies to object methods in both syntax styles. For example, `TEACH greet name, name` inside `CLASS Player` reports `Method Player.greet declares parameter name more than once. Give each parameter a different name.`
Simple functions and object methods can also declare a return type. `claro typecheck` checks each `RETURN` expression against it and reports a missing return when a declaration never returns a value:
```claro