Check for void/noreturn in conditionals
[hiphop-php.git] / hphp / hack / test / typecheck / instanceof_newtype.php
blobf28c0bc77f0f23ff8bd0528f8a1a7274b503468e
1 //// file1.php
2 <?hh
3 class Foo {
4 public $field;
7 newtype MyFoo as Foo = Foo;
9 function make(Foo $x): ?MyFoo {
10 return $x->field > 0 ? $x : null;
13 //// file2.php
14 <?hh // strict
16 function test(mixed $x, MyFoo $y): MyFoo {
17 invariant($x instanceof $y, '');
18 hh_show($x);
19 return $x;