Handle this typehints
commitd0d80a5aab57c748df747e261189d40643a42137
authorKunal Mehta <kunalm@fb.com>
Wed, 21 Mar 2018 17:31:35 +0000 (21 10:31 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Wed, 21 Mar 2018 17:58:01 +0000 (21 10:58 -0700)
tree64e1d7ae9c64144239d1eb1d7b4d6542fa14da02
parentdc1dcc5d088c1930d02befe26a107b39d4aa53d4
Handle this typehints

Summary:
This desugars `$x is this` to `is_object($x) && get_class($x) === get_called_class()`, again using the new definition of `this` to mean "exactly the LSB class."

This also supports the `dynamic` typehint while we're in the neighborhood—similarly to `mixed`, any type is compatible with `dynamic`.

Reviewed By: oulgen

Differential Revision: D7158287

fbshipit-source-id: abcef6c71408f58a630c5ace748dad7e56d381dd
hphp/hack/src/hhbc/emit_expression.ml
hphp/test/slow/is_expression/is-expression-this.php [new file with mode: 0644]
hphp/test/slow/is_expression/is-expression-this.php.expect [new file with mode: 0644]
hphp/test/slow/is_expression/is-expression-this.php.onlyhackc [new file with mode: 0644]
hphp/test/slow/is_expression/is-expression-this2.php [new file with mode: 0644]
hphp/test/slow/is_expression/is-expression-this2.php.expect [new file with mode: 0644]
hphp/test/slow/is_expression/is-expression-this2.php.onlyhackc [new file with mode: 0644]