typecheck: reject extra AS TO field tokens

This commit is contained in:
Hermes Agent
2026-09-21 07:27:18 +00:00
parent aae8eb7608
commit 72a5589a3e
7 changed files with 29 additions and 1 deletions
@@ -57,6 +57,12 @@ class ValidateTypecheckDiagnosticsTests(unittest.TestCase):
MODULE.EXPECTED_OK,
)
def test_includes_as_to_typed_field_extra_tokens_fixture(self):
self.assertIn(
"tests/typecheck_object_field_typed_as_to_extra_tokens_bad.claro",
MODULE.EXPECTED,
)
def test_includes_as_to_method_field_success_fixtures(self):
self.assertIn(
"tests/typecheck_method_inline_field_annotation_as_to_good.claro",
@@ -0,0 +1,6 @@
CLASS Player
HAS score NUMBER
END
NEW Player player
SET player.score AS NUMBER TO 10 extra