add support for --pessimise_builtins to hh_expect
Summary:
`hh_expect_equivalent` has a slighlty odd behaviour wrt pessimisation. Consider
```
function test(shape('k' => vec<int>) $s): void {
$vec = Shapes::idx($s, 'k', vec[]);
hh_expect_equivalent<vec<int>>($vec);
}
```
After pessimisation `$vec : ~vec<int>` and, for pessimisation testing purposes, `hh_expect_equivalent` should accept `~vec<int>` as "equivalent" to `vec<int>`.
On the other hand, consider
```
function foo(): void {
$v = Vector {};
hh_expect_equivalent<Vector<int>>($v);
}
```
After pessimisation, `$v` still has type `Vector<int>`, and `hh_expect_equivalent` should accept `Vector<int>` as "equivalent" to `Vector<int>`.
I suggest that if `--pessimise-builtins` is selected,
```
hh_expect_equivalent<t2>($a)
```
where `$a : t1`, should implement the check
```
(t1 == t2 || t1 == ~t2)
```
Unless I am mistaken this can be simplified into
```
(t1 == t2 || t1 == ~t2)
<=> (t1 <: t2 && t2 <: t1) || (t1 <: ~t2 && ~t2 <: t1)
<=> (t1 <: t2 | ~t2) && (t2 & ~t2 <: t1)
<=> t1 <: ~t2 && t2 <: t1
```
(observe the asymmetry).
This diff implements the above and relaxes the check performed by hh_expect_equivalent into `t1 <: ~t2 && t2 <: t1` if `--pessimise-builtins` is enabled.
Reviewed By: andrewjkennedy
Differential Revision:
D33237479
fbshipit-source-id:
8faa1ccfec88e297d9a2c94486f51a779cac7c8c