No error on use of `unsafe_cast`
[hiphop-php.git] / hphp / hack / test / typecheck / inst_meth10.php
blob5fabfe71bb1a360428f3f776bcbf067f2fe977cb
1 <?hh // partial
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 B {
13 public function f1(string $x): int {
14 return 1;
18 class A {
19 private function f1(string $s): int {
20 return 1;
22 public function f2(A $x) {
23 $y = true;
24 if($y) {
25 $x = new B();
27 return inst_meth($x, 'f1');