No error on use of `unsafe_cast`
[hiphop-php.git] / hphp / hack / test / typecheck / init_closure.php
blob6ac93616bdcb5e1d10a2467543031054f3eead0b
1 <?hh // strict
2 /**
3 * Copyright (c) 2014, Facebook, Inc.
4 * All rights reserved.
6 * This source code is licensed under the MIT license found in the
7 * LICENSE file in the "hack" directory of this source tree.
12 class Bar {
13 public static function hey((function(): Bar) $cb): Bar {
14 return $cb();
18 class Foo {
19 private Bar $a, $b;
20 public function __construct() {
21 $this->a = Bar::hey(function() { return new Bar(); });
22 $this->b = Bar::hey(function() { return new Bar(); });