Correctly instantiate generic attributes for XHP
commit9f5227fad14dcbf9e1f8e9e3cffd5db96aaaecf7
authorDwayne Reeves <dreeves@fb.com>
Sun, 5 Jun 2016 15:21:59 +0000 (5 08:21 -0700)
committerHhvm Bot <hhvm-bot-bot@fb.com>
Sun, 5 Jun 2016 15:31:59 +0000 (5 08:31 -0700)
treead66df28e8e46ecd6038a951112d0fb4e08981f1
parentec7c01f4f183b851ef79817e6b9367b731d36611
Correctly instantiate generic attributes for XHP

Summary:
We weren't properly instantiating the `this` type or generics for XHP literals
because we fetched the type directly from `class_type.tc_prop`. There is a lot
of logic involved in properly resolving these types, so the easiest thing to do
was to get the types of the individual attributes via `Typing.obj_get` to make
sure expression dependent types and generics are instantiated correctly.

Reviewed By: andrewjkennedy

Differential Revision: D3375690

fbshipit-source-id: 76f160ff39a56bbf3a9822bdb5ce0b79421c9204
13 files changed:
hphp/hack/src/typing/typing.ml
hphp/hack/test/h2tp/convert_hack_test_inputs_base.py
hphp/hack/test/typecheck/xhp/generic_attr1.php [new file with mode: 0644]
hphp/hack/test/typecheck/xhp/generic_attr1.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/xhp/generic_attr2.php [new file with mode: 0644]
hphp/hack/test/typecheck/xhp/generic_attr2.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/xhp/generic_attr3.php [new file with mode: 0644]
hphp/hack/test/typecheck/xhp/generic_attr3.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/xhp/generic_attr_constraint.php [new file with mode: 0644]
hphp/hack/test/typecheck/xhp/generic_attr_constraint.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/xhp/this_type_attr.php [new file with mode: 0644]
hphp/hack/test/typecheck/xhp/this_type_attr.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/xhp_attr_23.php.exp