No error on use of `unsafe_cast`
[hiphop-php.git] / hphp / hack / test / typecheck / expected_constvec.php
blobed16ef06c67b1bbd25a01227098b67a3ef3c55a8
1 <?hh
2 // Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
4 class C {
5 public function foo():int { return 3; }
8 function test1():ConstVector<(function(C):int)> {
9 return ImmVector { $x ==> $x->foo() };
11 function test2():MutableVector<(function(C):int)> {
12 return Vector { $x ==> $x->foo() };
14 function test3():ConstMap<int,(function(C):int)> {
15 return ImmMap { 1 => $x ==> $x->foo() };
17 function test4():MutableMap<int,(function(C):int)> {
18 return Map { 1 => $x ==> $x->foo() };