3 // This test cases checks for a previous bug that
4 // $$ loses its typing information in a ternary
5 // expression. In this bug case the $$ will have Tany,
6 // hence passing both checks. Had it been properly typed,
7 // this will report a type error at expect_string
8 function expect_fail(bool $b): void
{
9 $broken = 1 |
> ($b ? $$
: $$
);
11 expect_string($broken);
14 function expect_int(int $i): void
{}
15 function expect_string(string $s): void
{}