Error on self::class on non final classes
[hiphop-php.git] / hphp / hack / test / typecheck / this4.php
blob1ecb35ab7125ede9098b702d0e29b96636deca7c
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 function test(): int {
30 $x = new X(0);
31 return $x->foo()->bar();