Check for void/noreturn in conditionals
[hiphop-php.git] / hphp / hack / test / typecheck / protected_inherit.php
blobf561b8f093d9eeb611caa6bbbcef307bc0312176
1 <?hh // strict
3 /**
4 * Copyright (c) 2014, Facebook, Inc.
5 * All rights reserved.
7 * This source code is licensed under the BSD-style license found in the
8 * LICENSE file in the "hack" directory of this source tree. An additional grant
9 * of patent rights can be found in the PATENTS file in the same directory.
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(); }