Shapes::at -- typing implementation
commit6987785727baef625d736acb6f445942dd9a4f4a
authorKevin Viratyosin <viratyosin@fb.com>
Thu, 9 May 2019 20:03:13 +0000 (9 13:03 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Thu, 9 May 2019 20:19:51 +0000 (9 13:19 -0700)
tree79b0bf3cbeb8a1671cb4d6a3eef064ff29969b31
parente4c1a34cc728cbb1b436328d112f973550dc2cfb
Shapes::at -- typing implementation

Summary:
Implement custom typing for `Shapes::at` which allows for access of optional (or implicit in the case of `...`) fields on shapes, throwing if the field is missing.

* The runtime implementation is in the previous diff
* Refinement of the input shape is implemented in the next diff

Reviewed By: manzyuk

Differential Revision: D15070293

fbshipit-source-id: 283f783b5d7067859c72eeecd36b9e7b156e6d37
13 files changed:
hphp/hack/hhi/Shapes.hhi
hphp/hack/src/errors/error_codes.ml
hphp/hack/src/errors/errors.ml
hphp/hack/src/errors/errors.mli
hphp/hack/src/naming/naming_special_names.ml
hphp/hack/src/typing/tast_check/shape_field_check.ml
hphp/hack/src/typing/typing.ml
hphp/hack/src/typing/typing_shapes.ml
hphp/hack/test/errors/error_map.ml
hphp/hack/test/typecheck/shape/shape_field_check/shape_at2.php [new file with mode: 0644]
hphp/hack/test/typecheck/shape/shape_field_check/shape_at2.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/shape_at1.php [new file with mode: 0644]
hphp/hack/test/typecheck/shape_at1.php.exp [new file with mode: 0644]