Add tests for not virtualized functions
[hiphop-php.git] / hphp / hack / test / typecheck / expression_trees_not_virtualize_functions / splice_state.php
blob8edcedb64b54d4d8a0697893633ec4deb92cc72c
1 <?hh
3 <<file:__EnableUnstableFeatures('expression_trees')>>
5 class Foo {
6 public ?int $x;
7 public function reset(): int {
8 return 1;
12 function lift<T>(T $_): ExprTree<ExampleDsl, ExampleDsl::TAst, T> {
13 throw new Exception();
16 // This technically shouldn't throw an error.
17 // It currently is due to typechecking the current desugaring
18 // So, for the moment, allow this error to be thrown and fix the desugaring
19 function test(): void {
20 $x = new Foo();
22 if ($x->x !== null) {
23 $_ = ExampleDsl`() ==> {
24 // We know that $x->x is not null
25 ${lift($x->x + 1)};
26 return;
27 }`;