Check for void/noreturn in conditionals
[hiphop-php.git] / hphp / hack / test / typecheck / trait_matching2.php
blob34ea9d955d2313cf65b020f1803e81d38a913107
1 <?hh // strict
2 /**
3 * Copyright (c) 2014, Facebook, Inc.
4 * All rights reserved.
6 * This source code is licensed under the BSD-style license found in the
7 * LICENSE file in the "hack" directory of this source tree. An additional grant
8 * of patent rights can be found in the PATENTS file in the same directory.
12 trait MyTrait {
13 abstract protected function lol(): int;
15 public function getInt(): int {
16 return $this->lol();
20 class C {
21 use MyTrait;
23 protected function lol(): string {
24 return 'hello world';
28 function takes_int(int $i): void {}
30 function broken(): void {
31 $c = new C();
32 takes_int($c->getInt());
35 // broken();