Error on self::class on non final classes
[hiphop-php.git] / hphp / hack / test / typecheck / gen_trait1.php
blobbf6ce96b9e7db94deec4774ddeab4d0549e2c80f
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 trait MyTrait<T> {
13 protected Vector<T> $a;
14 public function test(): T {
15 return $this->a[0];
19 class A {
20 use MyTrait<int>;
22 public function __construct(int $x) {
23 $this->a = Vector { $x };