typecheck: validate simple function returns

This commit is contained in:
Hermes Agent
2026-09-08 19:31:29 +00:00
parent c44db0bb16
commit 8fe57974c6
9 changed files with 51 additions and 6 deletions
+4
View File
@@ -19,6 +19,9 @@ EXPECTED = {
"tests/typecheck_function_bad.claro": [
"tests/typecheck_function_bad.claro:5: Type mismatch for function square: parameter amount needs NUMBER, but this argument looks like TEXT.",
],
"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_multi_bad.claro": [
"tests/typecheck_function_multi_bad.claro:8: Type mismatch for function label: parameter name needs TEXT, but this argument looks like NUMBER.",
"tests/typecheck_function_multi_bad.claro:8: Type mismatch for function label: parameter age needs NUMBER, but this argument looks like TEXT.",
@@ -177,6 +180,7 @@ EXPECTED = {
EXPECTED_OK = [
"tests/typecheck_function_good.claro",
"tests/typecheck_function_return_good.claro",
"tests/typecheck_function_multi_good.claro",
"tests/typecheck_method_good.claro",
"tests/typecheck_method_call_good.claro",