test: cover compatibility duplicate method names

This commit is contained in:
Hermes Agent
2026-09-16 11:45:26 +00:00
parent 50ef925367
commit 7eff213a78
5 changed files with 18 additions and 3 deletions
+1 -1
View File
@@ -177,7 +177,7 @@ 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.`
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.` Duplicate method names are also rejected in both modern `END` methods and compatibility `TAKES` / `LEARNED` methods, with a rename hint before a call can become ambiguous.
Object methods must also have unique names within their class. If `CLASS Player` declares `TEACH show` twice, `claro typecheck` reports `Method Player.show is declared more than once. Give each method a different name.` Rename one method before calling it.