Check for void/noreturn in conditionals
[hiphop-php.git] / hphp / hack / test / typecheck / namespace_basic.php
blobe2368c055c955258532bdb4f5f14f4421228b613
1 <?hh // strict
2 /**
3 * Copyright (c) 2014, Facebook, Inc.
4 * All rights reserved.
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.
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> {}