typecheck: identify methods missing return types
This commit is contained in:
@@ -92,6 +92,10 @@ class ValidateTypecheckDiagnosticsTests(unittest.TestCase):
|
||||
def test_includes_missing_function_return_fixture(self):
|
||||
self.assertIn("tests/typecheck_function_missing_return_bad.claro", MODULE.EXPECTED)
|
||||
|
||||
def test_includes_missing_method_return_type_fixtures(self):
|
||||
self.assertIn("tests/typecheck_method_missing_return_type_bad.claro", MODULE.EXPECTED)
|
||||
self.assertIn("tests/typecheck_method_compat_missing_return_type_bad.claro", MODULE.EXPECTED)
|
||||
|
||||
def test_includes_branch_missing_function_return_fixture(self):
|
||||
self.assertIn("tests/typecheck_function_branch_missing_return_bad.claro", MODULE.EXPECTED)
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
CLASS Player
|
||||
TEACH score TAKES amount RETURNS
|
||||
RETURN amount
|
||||
LEARNED
|
||||
END
|
||||
@@ -0,0 +1,5 @@
|
||||
CLASS Player
|
||||
TEACH score RETURNS
|
||||
RETURN 1
|
||||
END
|
||||
END
|
||||
Reference in New Issue
Block a user