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.
13 public function render(): string;
16 class B
implements A
{
17 public function render(): string { return 'foo'; }
20 function toto(A
$x): void
{
24 function foo
<T
as A
>(Vector
<T
> $x): Vector
<T
> {
30 function test_vector(): void
{
31 $x = foo(Vector
{new B()});
34 function foo2
<T
as A
>(T
$x): T
{
42 public function foo
<T
as A
>(T
$x): T
{
49 class Y
extends X
implements A
{
51 public function test(): Y
{
52 return $this->foo($this);
55 public function render(): string {
60 function test(): Vector
<B
> {
62 return foo(Vector
{});
67 private ?T
$data = null;
69 public function set(T
$x): void
{ $this->data
= $x; }
70 public function get(): ?T
{ return $this->data
; }
73 function test2(): void
{
78 class U
<T
as A
> extends L
<T
> {
79 public function get(): ?T
{ return parent
::get(); }
82 function test3(): void
{
86 function test4
<T1
, T2
, T3
as KeyedIterable
<T1
, T2
>>(T3
$x): void
{
87 foreach($x as $k => $v) {
92 function test5
<T
as ?
int>(T
$x): T
{