Disallow ... without type in function typehints
[hiphop-php.git] / hphp / hack / test / typecheck / tuple_union.php
blob9a6fae1f6aea10b03ca12d3524ec8f7a1f96cda9
1 <?hh // strict
3 function id<T>(T $x): T {
4 return $x;
7 function apply<Ta, Tb>(Ta $x, (function(Ta): Tb) $f): Tb {
8 return $f($x);
11 function test(bool $x): (arraykey, int) {
12 return apply(
13 $x,
14 $x ==> {
15 if ($x) {
16 return tuple(42, 1);
18 return tuple(id('foo'), 2);