New inference: improved error message for unresolved type
[hiphop-php.git] / hphp / hack / test / typecheck / protected_inherit.php
blob945148888b9997aeb80a05f4dda0e68da342a93d
1 <?hh // strict
3 /**
4 * Copyright (c) 2014, Facebook, Inc.
5 * All rights reserved.
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the "hack" directory of this source tree.
12 class AAA {
13 protected function foo(): string { return 'a'; }
15 class BBB extends AAA {
16 protected function foo(): string { return 'b'; }
18 class CCC extends AAA {
19 public function bar(): string { return (new BBB())->foo(); }
20 public function baz(): string { return $this->bbb()->foo(); }
21 private function bbb(): AAA { return new BBB(); }