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 $b1, bool $b2): void
{
10 |
> ($b1 ?
($b2 ? $$
: $$
) : ($b2 ? $$
: $$
));
12 expect_string($broken);
15 function int2string(int $i): string {
18 function expect_int(int $i): void
{}
19 function expect_string(string $s): void
{}