Validate shape keys on type constant definitions
commitc786c6de34235c2d3473c4751567ac537f1fce08
authorMike Qian <mqian@fb.com>
Thu, 25 Apr 2019 00:45:20 +0000 (24 17:45 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Thu, 25 Apr 2019 00:49:10 +0000 (24 17:49 -0700)
treed1d5acc9aacefb9a906e408d3dc8ee04822071d3
parent42369466a1e1a0a140bccf83fceff5d11487c4dd
Validate shape keys on type constant definitions

Summary: We need to make sure the field names are valid, just like we do for shapes declared as type aliases.

Reviewed By: manzyuk

Differential Revision: D15054177

fbshipit-source-id: 583bfb81e1e52eac01507e8ca65d7dcc10c0ed48
12 files changed:
hphp/hack/src/typing/typing.ml
hphp/hack/test/typecheck/shape/shape_field_check/shape_idx_with_default_argument.php
hphp/hack/test/typecheck/shape/shape_field_check/shape_idx_with_default_argument.php.exp
hphp/hack/test/typecheck/shape/shape_field_check/shape_idx_with_default_argument_2.php
hphp/hack/test/typecheck/shape/shape_field_check/shape_idx_with_default_argument_2.php.exp
hphp/hack/test/typecheck/shape/shape_field_check/shape_idx_with_default_argument_3.php
hphp/hack/test/typecheck/shape/shape_typeconst1.php [new file with mode: 0644]
hphp/hack/test/typecheck/shape/shape_typeconst1.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/shape/shape_typeconst2.php [new file with mode: 0644]
hphp/hack/test/typecheck/shape/shape_typeconst2.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/shape/shape_typeconst3.php [new file with mode: 0644]
hphp/hack/test/typecheck/shape/shape_typeconst3.php.exp [new file with mode: 0644]