3 * Copyright (c) 2014, Facebook, Inc.
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 abstract class MyVector
<T
> {
13 abstract public function map
<Tu
>((function(T
): Tu
) $callback): MyVector
<Tu
>;
14 abstract public function at(int $k): T
;
15 abstract public function isEmpty(): bool;
18 static public function newVector(T
$x): MyVector
<T
> {
24 public function getName(): string { return 'hello'; }
29 * There was a weird bug in Typing_generic.rename, that was reproduced with
30 * this case. It had to do with variable renaming, and this test doesn't
31 * exercise much beyond that
34 public function foo(MyVector
<A
> $a_vector): void
{
35 $bars = $a_vector->map(function (A
$x) { return MyVector
::newVector($x); });
36 if (!$bars->isEmpty()) {
37 $bars->at(1)->at(1)->getName();