No error on use of `unsafe_cast`
[hiphop-php.git] / hphp / hack / test / typecheck / fake_members7.php
blob4734e759b7fb0b42ed92f14734e2110c5f89ea7c
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 function do_something(): void {
15 class X {
16 private mixed $x;
18 public function __construct() {
19 $this->x = '';
22 public function getX(): Z {
23 if($this->x is Z) {
24 return $this->x;
26 return new Z();
30 class Z {}