No error on use of `unsafe_cast`
[hiphop-php.git] / hphp / hack / test / typecheck / generic_fun_3.php
bloba5fe5ad83b384192574c8d218b9cbca698583f82
1 <?hh // strict
2 // Copyright 2004-present Facebook. All Rights Reserved.
4 function darray_filter<Tk as arraykey, Tv>(
5 KeyedTraversable<Tk, Tv> $traversable,
6 ?(function(Tv): bool) $f,
7 ): darray<Tk, Tv> {
8 return darray[];
11 function is_not_null<T>(T $x): bool {
12 return false;
14 class C {}
15 class D {}
16 function testit(varray<?C> $vc, varray<?D> $vd): void {
17 $func = fun('is_not_null');
18 $a = darray_filter($vd, $func);
19 $b = darray_filter($vc, $func);