typecheck: name methods in field diagnostics

This commit is contained in:
Hermes Agent
2026-09-13 10:58:08 +00:00
parent 8e9ab3c711
commit 915bc7f1bc
9 changed files with 42 additions and 8 deletions
+4
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_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.",
],
}
EXPECTED_OK = [
@@ -305,6 +308,7 @@ EXPECTED_OK = [
"tests/typecheck_method_return_addition_good.claro",
"tests/typecheck_method_unknown_return_expression_good.claro",
"tests/typecheck_method_field_assignment_good.claro",
"tests/typecheck_method_text_field_assignment_good.claro",
"tests/typecheck_method_nested_branch_complete_good.claro",
"tests/typecheck_function_multi_good.claro",
"tests/typecheck_method_good.claro",