sync the repo
[hiphop-php.git] / hphp / hack / test / typecheck / namespace_basic.php
blob53d08a4c37992ce0dcb5992df32d1186c4d64fa7
1 <?hh
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 namespace NS1\NS2 {
13 trait MyTrait<T1, T2> {}
15 function f(): void {
16 f();
17 \NS1\NS2\f();
20 class C<T> {
21 use MyTrait<T, int>;
23 public static function g(): void {
24 C::g();
25 \NS1\NS2\C::g();
28 public function h(): void {
29 $this->h();
32 public function i(C<T> $x): \NS1\NS2\C<T> {
33 return $x;
37 function id<T>(T $x): T {
38 return $x;
41 function id2<T as C<int>>(T $x): T {
42 return $x;
45 function id3<T as \NS1\NS2\C<int>>(T $x): T {
46 return $x;
50 namespace NS3 {
51 class C2 extends \NS1\NS2\C<int> {}