Error if fields are repeated in record declarations or instances
commite587f9cede57fc853ae3bd1d1386b977c0b800cd
authorWilfred Hughes <wilfred@fb.com>
Tue, 29 Oct 2019 17:13:41 +0000 (29 10:13 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 29 Oct 2019 17:16:34 +0000 (29 10:16 -0700)
treeba8179be47655011582fdb984816645b9cc4f593
parentaae52e391de69883a1d7f360815538f51a57c456
Error if fields are repeated in record declarations or instances

Summary:
Ensure that field names cannot be repeated in a record declaration:

```
record Foo {
  x: int,
  x: int,
}
```

 or record instantiation:

```
Foo['x' => 1, 'x' => 1];
```

Reviewed By: kmeht

Differential Revision: D18062899

fbshipit-source-id: 15abdabc44daf0abeb32a7886426bec3d665a6de
hphp/hack/src/errors/error_codes.ml
hphp/hack/src/errors/errors.ml
hphp/hack/src/errors/errors.mli
hphp/hack/src/typing/nast_check/nast_check.ml
hphp/hack/src/typing/nast_check/record_field_check.ml [new file with mode: 0644]
hphp/hack/src/typing/nast_visitor.ml
hphp/hack/test/errors/error_map.ml
hphp/hack/test/typecheck/records/record_decl_duplicate_field.php [new file with mode: 0644]
hphp/hack/test/typecheck/records/record_decl_duplicate_field.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/records/record_instance_duplicate_field.php [new file with mode: 0644]
hphp/hack/test/typecheck/records/record_instance_duplicate_field.php.exp [new file with mode: 0644]