Untyped variadic function types should not be permitted in strict mode
[hiphop-php.git] / hphp / hack / test / typecheck / ternary7.php
bloba25eff325d39b211d674e5fa022a8f799b14dc9a
1 <?hh
3 function takes_int(int $x) { }
5 function f() {
6 $a = 1;
7 if (true) {} // this makes $a into a Tvar mapped to a Tunresolved[int]
8 /* We used to unify both branches of a ternary expression, then falling back
9 * to creating a Tunresolved if unification failed; this would create a false
10 * positive error for the code below.
12 true ? null : $a;
13 takes_int($a);