Implement shapes with class constant fields.
commit26881dfb40c41c1cad306a199dc3b4ccd1ec7905
authorMichael Sullivan <msullivan@fb.com>
Fri, 18 Jul 2014 20:08:45 +0000 (18 13:08 -0700)
committerfacebook-github-bot <githubbot@fb.com>
Fri, 18 Jul 2014 20:30:19 +0000 (18 13:30 -0700)
tree4fd5fb2d5d817ef720d0a3e82f1f7d41d6f49314
parentb7c01079b32d91b0fe2b18bc6515c10d566be74b
Implement shapes with class constant fields.

Summary: Add support for using class constants as field names in shapes to Hack. Shapes must either use all class constants or all strings. Class constants can either be ints or strings, but must all be the same. This doesn't include extending HHVM to support them.

Reviewed By: jwatzman, eletuchy

Differential Revision: D1377943
40 files changed:
hphp/hack/src/naming/naming.ml
hphp/hack/src/naming/nast.ml
hphp/hack/src/naming/nastVisitor.ml
hphp/hack/src/parsing/ast.ml
hphp/hack/src/parsing/parser_hack.ml
hphp/hack/src/typing/nastCheck.ml
hphp/hack/src/typing/nastInitCheck.ml
hphp/hack/src/typing/typing.ml
hphp/hack/src/typing/typing.mli
hphp/hack/src/typing/typing_compare.ml
hphp/hack/src/typing/typing_decl.ml
hphp/hack/src/typing/typing_defs.ml
hphp/hack/src/typing/typing_env.ml
hphp/hack/src/typing/typing_expand.ml
hphp/hack/src/typing/typing_extends.ml
hphp/hack/src/typing/typing_generic.ml
hphp/hack/src/typing/typing_hint.ml
hphp/hack/src/typing/typing_inherit.ml
hphp/hack/src/typing/typing_instantiate.ml
hphp/hack/src/typing/typing_subtype.ml
hphp/hack/src/typing/typing_tdef.ml
hphp/hack/src/typing/typing_utils.ml
hphp/hack/src/utils/errors.ml
hphp/hack/src/utils/errors.mli
hphp/hack/src/utils/utils.ml
hphp/hack/test/typecheck/shape6.php.exp
hphp/hack/test/typecheck/shapes_cc_1.php [new file with mode: 0644]
hphp/hack/test/typecheck/shapes_cc_1.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/shapes_cc_2.php [new file with mode: 0644]
hphp/hack/test/typecheck/shapes_cc_2.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/shapes_cc_3.php [new file with mode: 0644]
hphp/hack/test/typecheck/shapes_cc_3.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/shapes_cc_4.php [new file with mode: 0644]
hphp/hack/test/typecheck/shapes_cc_4.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/shapes_cc_5.php [new file with mode: 0644]
hphp/hack/test/typecheck/shapes_cc_5.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/shapes_cc_6.php [new file with mode: 0644]
hphp/hack/test/typecheck/shapes_cc_6.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/shapes_cc_7.php [new file with mode: 0644]
hphp/hack/test/typecheck/shapes_cc_7.php.exp [new file with mode: 0644]