Replace `fun` and `class_meth` with function pointers in `hh` tests
[hiphop-php.git] / hphp / hack / test / typecheck / constraints / class_meth_generics_bad.php
blobb6f28cf72eb4e799b3cb48fce2906243a010c77e
1 <?hh // strict
2 // Copyright 2004-present Facebook. All Rights Reserved.
4 class C<T as arraykey> {
5 public static function nongeneric(T $x): T {
6 return $x;
8 public static function generic<Tu>(T $x, Tu $y): (T, Tu) {
9 return tuple($x, $y);
11 public static function genericConstrained<Tu as arraykey>(
12 T $x,
13 Tu $y,
14 ): (T, Tu) {
15 return tuple($x, $y);
19 function testindirect1(bool $b): bool {
20 $f = C::nongeneric<>;
21 $fr = $f($b);
22 return $fr;
25 function testindirect2(float $f, vec<int> $v): (float, vec<int>) {
26 $g = C::generic<>;
27 $gr = $g($f, $v);
28 return $gr;
30 function testindirect3(float $f, vec<int> $v): (float, vec<int>) {
31 $g = C::genericConstrained<>;
32 $gr = $g($f, $v);
33 return $gr;