typecheck: diagnose empty typed returns

This commit is contained in:
Hermes Agent
2026-09-09 07:54:19 +00:00
parent 465f3f4d26
commit 257a4644ad
8 changed files with 25 additions and 4 deletions
+3
View File
@@ -28,6 +28,9 @@ EXPECTED = {
"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_function_empty_return_bad.claro": [
"tests/typecheck_function_empty_return_bad.claro:3: Function square needs a NUMBER value after RETURN. Add a NUMBER expression.",
],
"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.",
],