Untyped variadic function types should not be permitted in strict mode
[hiphop-php.git] / hphp / hack / test / typecheck / fun_generics_bad.php
blobdf1e54331a67ed325e00216b5e453f4caba402a9
1 <?hh // strict
2 // Copyright 2004-present Facebook. All Rights Reserved.
4 function cannot_be_nullable(int $val): int {
5 return $val;
8 function special_array_map<T1, T2>(
9 (function(T1): T2) $f,
10 array<int, T1> $a,
11 ): array<int, T2> {
12 // UNSAFE
15 function demo(): bool {
16 $array = array();
18 for ($k = 0; $k < 10; $k++) {
19 $array[$k] = null;
22 $fun1 = fun('cannot_be_nullable');
24 $val1 = special_array_map($fun1, $array);
26 return (bool)$val1;
29 /* HH_FIXME[1002] Just a demo */
30 demo();