Disallow ... without type in function typehints
[hiphop-php.git] / hphp / hack / test / typecheck / functional_anon_fun.php
blobfc7f3ec00500c8ad933a095eb9db8e68fb1bfcf7
1 <?hh // strict
2 /**
3 * Copyright (c) 2014, Facebook, Inc.
4 * All rights reserved.
6 * This source code is licensed under the MIT license found in the
7 * LICENSE file in the "hack" directory of this source tree.
12 class A {
14 public function doStuff(): void {
15 return;
19 function f(int $x): int {
20 $f = function($y) use ($x) {
21 return $y->doStuff();
23 call_user_func($f, new A());
24 return call_user_func($f, new A());