No error on use of `unsafe_cast`
[hiphop-php.git] / hphp / hack / test / typecheck / this3.php
blobc500fd35fc1306e618b34ae8659a7f14e7346d22
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 X<T1, T2> {
14 private T1 $x;
16 public function __construct(T1 $x) {
17 $this->x = $x;
20 public function foo(): this {
21 return $this;
24 public function bar(): T1 {
25 return $this->x;
29 class Y<T1, T2> extends X<int, T2> {
31 public function test(): int {
32 return $this->foo()->bar();