BaseL instructions and corresponding tests
[hiphop-php.git] / hphp / test / slow / readonly / local_variable_vector.php
blobd19dec8ac3c038887cd92b58800a4f8085c9be49
1 <?hh
2 <<file:__EnableUnstableFeatures('readonly')>>
3 class Baz {
5 class Foo {
6 public int $prop;
7 public readonly vec<Foo> $bar = vec[];
8 public static readonly vec<Foo> $static_vec = vec[];
9 public readonly Baz $baz;
10 public function __construct() {
11 $this->prop = 1;
12 $this->baz = new Baz();
16 <<__EntryPoint>>
17 function main(): void {
18 $y = Vector { readonly new Foo() };
19 $y[] = new Foo(); // error $y should be readonly
20 echo "Done\n";