Add tests for not virtualized functions
[hiphop-php.git] / hphp / hack / test / typecheck / expression_trees_not_virtualize_functions / namespace.php
blob27eb9d803f767b3ae7b1c30a75847bed9414d225
1 <?hh
3 <<file:__EnableUnstableFeatures('expression_trees')>>
5 namespace Bar {
7 class MyExampleDsl {
8 const type TAst = mixed;
10 public static function makeTree<<<__Explicit>> TInfer>(
11 ?\ExprPos $pos,
12 shape(
13 'splices' => dict<string, mixed>,
14 'functions' => vec<mixed>,
15 'static_methods' => vec<mixed>,
16 ) $metadata,
17 (function(MyExampleDsl): MyExampleDsl::TAst) $ast,
18 ): \ExprTree<MyExampleDsl, MyExampleDsl::TAst, TInfer> {
19 throw new \Exception();
22 // Virtual types (These do not have to be implemented)
23 public static function intType(): \ExampleInt {
24 throw new \Exception();
27 // Desugared nodes (These should be implemented)
28 public function visitInt(?\ExprPos $_, int $_): MyExampleDsl::TAst {
29 throw new \Exception();
33 } // namespace Bar
35 namespace {
37 function test(): void {
38 Bar\MyExampleDsl`1`;
41 } // namespace