typecheck: diagnose unknown return expressions

This commit is contained in:
Hermes Agent
2026-09-11 03:22:05 +00:00
parent b7d19db8a9
commit 34f96a6d7d
8 changed files with 42 additions and 5 deletions
@@ -49,6 +49,16 @@ class ValidateTypecheckDiagnosticsTests(unittest.TestCase):
self.assertIn("tests/typecheck_function_return_bad.claro", MODULE.EXPECTED)
self.assertIn("tests/typecheck_function_return_good.claro", MODULE.EXPECTED_OK)
def test_includes_unknown_function_return_expression_fixtures(self):
self.assertIn(
"tests/typecheck_function_unknown_return_expression_bad.claro",
MODULE.EXPECTED,
)
self.assertIn(
"tests/typecheck_function_unknown_return_expression_good.claro",
MODULE.EXPECTED_OK,
)
def test_includes_lowercase_compatibility_return_success_fixture(self):
self.assertIn(
"tests/typecheck_function_lowercase_return_good.claro",
@@ -0,0 +1,3 @@
TEACH square amount RETURNS NUMBER
RETURN missing
END
@@ -0,0 +1,4 @@
TEACH square amount RETURNS NUMBER
CHECK TYPE amount IS NUMBER
RETURN amount
END