Check for void/noreturn in conditionals
[hiphop-php.git] / hphp / hack / test / typecheck / test_inter.php
blob153d9c66c98077f999b2aaee4d5b8a3523a7f3bc
1 <?hh
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 interface I {}
13 class A implements I {}
14 class B implements I {}
16 function inter_switch(): I {
17 switch(9) {
18 case 0:
19 $x = new A();
20 break;
21 case 1:
22 $x = new B();
23 break;
24 default:
25 throw new Exception('bad');
27 return $x;