typecheck: validate method field return types

This commit is contained in:
Hermes Agent
2026-09-11 01:16:31 +00:00
parent e28388407d
commit b7d19db8a9
8 changed files with 28 additions and 4 deletions
+4
View File
@@ -52,6 +52,9 @@ EXPECTED = {
"tests/typecheck_method_return_expression_bad.claro": [
"tests/typecheck_method_return_expression_bad.claro:4: Type mismatch for return from Player.label: expected TEXT, but this value looks like NUMBER.",
],
"tests/typecheck_method_field_return_bad.claro": [
"tests/typecheck_method_field_return_bad.claro:5: Type mismatch for return from Player.label: expected TEXT, but this value looks like NUMBER.",
],
"tests/typecheck_method_missing_return_bad.claro": [
"tests/typecheck_method_missing_return_bad.claro:4: Method Player.score declares RETURNS NUMBER but has no RETURN statement. Add RETURN with a NUMBER value.",
],
@@ -236,6 +239,7 @@ EXPECTED_OK = [
"tests/typecheck_function_branch_complete_good.claro",
"tests/typecheck_function_nested_branch_complete_good.claro",
"tests/typecheck_method_return_good.claro",
"tests/typecheck_method_field_return_good.claro",
"tests/typecheck_method_compat_return_good.claro",
"tests/typecheck_method_compat_lowercase_return_good.claro",
"tests/typecheck_method_return_expression_good.claro",