test: cover compatibility numeric method field assignment
This commit is contained in:
@@ -208,6 +208,12 @@ class ValidateTypecheckDiagnosticsTests(unittest.TestCase):
|
||||
MODULE.EXPECTED_OK,
|
||||
)
|
||||
|
||||
def test_includes_compatibility_number_method_field_assignment_success_fixture(self):
|
||||
self.assertIn(
|
||||
"tests/typecheck_method_compat_field_assignment_good.claro",
|
||||
MODULE.EXPECTED_OK,
|
||||
)
|
||||
|
||||
def test_includes_method_field_check_type_fixtures(self):
|
||||
self.assertIn(
|
||||
"tests/typecheck_method_field_check_type_bad.claro",
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
CLASS Player
|
||||
HAS score NUMBER
|
||||
TEACH add TAKES amount
|
||||
SET score amount + 1
|
||||
LEARNED
|
||||
ENDCLASS
|
||||
|
||||
NEW Player player
|
||||
CALL player.add WITH 4
|
||||
Reference in New Issue
Block a user