typecheck: diagnose missing declared returns

This commit is contained in:
Hermes Agent
2026-09-08 23:39:45 +00:00
parent 9d4cffa6f6
commit 0f63ab0c71
7 changed files with 24 additions and 6 deletions
+3
View File
@@ -22,6 +22,9 @@ EXPECTED = {
"tests/typecheck_function_return_bad.claro": [
"tests/typecheck_function_return_bad.claro:3: Type mismatch for return from square: expected NUMBER, but this value looks like TEXT.",
],
"tests/typecheck_function_missing_return_bad.claro": [
"tests/typecheck_function_missing_return_bad.claro:3: Function square declares RETURNS NUMBER but has no RETURN statement. Add RETURN with a NUMBER value.",
],
"tests/typecheck_method_return_bad.claro": [
"tests/typecheck_method_return_bad.claro:3: Type mismatch for return from Player.score: expected NUMBER, but this value looks like TEXT.",
],