Add module declaration type checking
[hiphop-php.git] / hphp / hack / test / typecheck / modules / module_class_expr.php
bloba35eca3a7db722c2ada1fdc096807717f6c0c333
1 //// modules.php
2 <?hh
3 <<file:__EnableUnstableFeatures('modules')>>
5 module here {}
6 module there {}
7 //// here.php
8 <?hh
9 // Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
10 <<file:__EnableUnstableFeatures('modules'), __Module('here')>>
12 <<__Internal>>
13 class C {
14 public function bar(mixed $m):void {
15 // All not ok
16 $x1 = new D();
17 $y1 = D::class;
18 D::foo();
19 // All ok
20 $x2 = new C();
21 $y2 = C::class;
22 C::foo();
23 $x3 = new self();
24 $y3 = self::class;
25 self::foo();
27 public static function foo():void { }
30 //// there.php
31 <?hh
32 // Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
33 <<file:__EnableUnstableFeatures('modules'), __Module('there')>>
35 <<__Internal>>
36 class D {
37 public static function foo():void { }