typecheck: reject duplicate class fields

This commit is contained in:
Hermes Agent
2026-09-16 03:30:52 +00:00
parent edcfd697f6
commit eddb3ba067
7 changed files with 18 additions and 2 deletions
+3
View File
@@ -22,6 +22,9 @@ EXPECTED = {
"tests/typecheck_method_duplicate_name_bad.claro": [
"tests/typecheck_method_duplicate_name_bad.claro:6: Method Player.show is declared more than once. Give each method a different name.",
],
"tests/typecheck_duplicate_field_bad.claro": [
"tests/typecheck_duplicate_field_bad.claro:3: Class Player declares field score more than once. Give each field a different name.",
],
"tests/typecheck_bad.claro": [
"tests/typecheck_bad.claro:2: Type mismatch for score: it was first set as NUMBER, but this value looks like TEXT.",
"tests/typecheck_bad.claro:3: Type mismatch for name: expected TEXT, but this value looks like NUMBER.",