3 * Copyright (c) 2014, Facebook, Inc.
6 * This source code is licensed under the BSD-style license found in the
7 * LICENSE file in the "hack" directory of this source tree. An additional grant
8 * of patent rights can be found in the PATENTS file in the same directory.
13 int function toto2(hashtable(string, int) $h) {
26 Error argument already bound
27 num function my_plus(num $x, num $x) {
33 int function my_plus(num $x, num $y) {
39 int function f(int $x) {
46 int function f(option(int) $y) {
55 int function f(option(int) $y) {
69 function __construct() {
80 int function f(int $n, int $y = 0) {
88 int function get(option(int) $x) {
100 string function test() {
113 public function __construct(T $x) {
117 public T function set_x(T $x) {
122 public T function get_x() {
135 int function f2(option(int) $x) {
144 T
function show(T
$x) { return $x; }
148 public option(int) $x;
150 public function __construct() {
154 public bool function get_x() {
166 //testing unify_fun_strict
168 public int function f(bool $x = true, bool $h = true) {
174 public int function f(bool $x, bool $y = true) {
190 public bool function f(A $x) { return true; }
196 bool function test() {
207 public A function f(A $x) {
212 return $x->f(new A());
221 public A function f(A $x) { return $x; }
225 public B function f(B $x) { return $x; }
226 public B function g(B $x) { return $x; }
229 bool function test() {
243 public A function f(A $x) {
251 public B function f(B $x) { return $x; }
252 public B function g(B $x) { return $x; }
256 bool function test() {
269 public function __construct(T $x) {
273 public bool function append(T $x) {
278 public T function get() {
286 bool function f(bool $x) { return true; }
290 bool function f(bool $x) { return true; }
291 bool function g(bool $x) { return true; }
295 bool function f(bool $x) { return true; }
296 bool function h(bool $x) { return true; }
302 bool function justA(A $x) { return true;}
303 bool function justC(C $x) { return true;}
306 $y = Map {'f00' => new A()};
307 $t = tuple(1, new A());
320 bool function test(L<A> $l) {
321 // $zz = $l->append(new C());
328 B function test44(L<A> $l) {
330 $zz = justC(new A());
338 bool function xx(A $x) {
351 bool function test2() {
353 return $x->get()->f(true);
359 public A<T> function f(T $x) {
360 return $this->f(new A());
367 public A<T2, T1> function f(A<T1, T2> $x) {
376 public T1 function f(T1 $x) {
379 public T2 function g(T2 $x) {
385 public float function f(int $x) {
388 public bool function g(bool $x, int $y = 0) {
394 public T2 function f(T2 $x) {
398 public T1 function g(T1 $x) {
403 bool function test3() {
404 return (new C() == new A());
411 bool function test2() {
423 option(T) function f(T $x) {
451 public int function f() { return 0; }
455 option(C1) function f(bool $x) { return null; }
459 option(C2) function f(bool $x, bool $y = true) { return null; }
460 bool function g(bool $x) { return true; }
463 bool function test(A $x, int $y) {
467 bool function test2() {
479 bool function f(bool $x) { return true; }
483 bool function f(bool $x) { return true; }
484 bool function g(bool $x) { return true; }
492 public function __construct(A $x) {
498 bool function f(bool $x) {
507 public A function f(A $x) { return new A(); }
511 public A function f(A $x) { return new A(); }
512 public B function g(B $x) { return $x; }
519 public function __construct(B $x) {
523 public bool function onstruct(A $x) {
524 $zz = $x->f($this->x);
536 public int function f() { return 0; }
540 C1 function f(C2 $x) { return $x; }
544 C1 function f(C2 $x) { return $x; }
545 bool function g(bool $x) { return true; }
548 bool function test(A $x, int $y) {
552 A function test2(B $x) {
554 if(true) { $b = new A(); }
563 private A
<T
> function f(T
$x) {
569 // parameter substitution
570 class C
<T
> extends A
<T
> {
571 public T
function get(T
$x) {
576 private A
<T
> function f(T
$x) {
581 int function test() {