typecheck: diagnose unknown method fields

This commit is contained in:
Hermes Agent
2026-09-14 05:33:09 +00:00
parent 5dd1616a1b
commit ae6c261156
6 changed files with 38 additions and 3 deletions
+3
View File
@@ -275,6 +275,9 @@ EXPECTED = {
"tests/typecheck_method_field_assignment_bad.claro": [
"tests/typecheck_method_field_assignment_bad.claro:5: Type mismatch for field score in Player.add: addition needs NUMBER values, but name looks like TEXT.",
],
"tests/typecheck_method_unknown_field_bad.claro": [
"tests/typecheck_method_unknown_field_bad.claro:5: Object Player has no field level. Check the field name or add HAS level NUMBER to the class.",
],
"tests/typecheck_method_text_field_assignment_bad.claro": [
"tests/typecheck_method_text_field_assignment_bad.claro:4: Type mismatch for field name in Player.rename: expected TEXT, but this value looks like NUMBER.",
],