No error on use of `unsafe_cast`
[hiphop-php.git] / hphp / hack / test / typecheck / finally_naming.php
bloba1498bc92dac6359032940f9e5fb04b3b9fe862f
1 <?hh // partial
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.
11 function might_throw(): void {}
13 function naming_finally(): int {
14 $a = 23;
15 try {
16 $a = 456;
17 might_throw();
18 $b = 789;
19 } catch (YourException $e) {
20 return $b == 23;
21 } catch (Exception $e) {
22 return $a == 456;
23 } finally {
24 echo $b; // b is unknown!
26 return $a;
29 class YourException extends Exception {}