No error on use of `unsafe_cast`
[hiphop-php.git] / hphp / hack / test / typecheck / functional_box.php
blob289347384a77ac4b70a0e45c02b7c642b798ebf4
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 Box<T> {
13 private T $x;
15 public function __construct(T $x) {
16 $this->x = $x;
19 public function set(T $x): void {
20 $this->x = $x;
23 public function get(): T {
24 return $this->x;
28 class Ent {}
30 class EntUser extends Ent {
32 public function iAmUser(): void {
33 return;
37 class EntPhoto extends Ent {}
39 class BoxEnt extends Box<Ent> {}