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