closes #9883
@@ -202,8 +202,12 @@ let rec func ctx bb tf t p =
end
) (false,[]) (List.rev el) in
let bb,values = List.fold_left (fun (bb,acc) (aff,opt,e) ->
- let bb,value = if aff || opt then bind_to_temp bb aff e else value bb e in
- bb,(value :: acc)
+ if bb == g.g_unreachable then
+ bb,acc
+ else begin
+ let bb,value = if aff || opt then bind_to_temp bb aff e else value bb e in
+ bb,(value :: acc)
+ end
) (bb,[]) el in
bb,List.rev values
and bind_to_temp ?(v=None) bb sequential e =
@@ -0,0 +1,24 @@
+package unit.issues;
+
+class Issue9883 extends unit.Test {
+ function test() {
+ eq("ok", silly());
+ }
+ static function callMe(d:Dynamic, f:Dynamic) {}
+ static function silly() {
+ callMe(return "ok", () -> {});
+ // This is unreachable, but our control flow detection chokes on this too...
+ return "not ok";
+ static function silly2() {
+ new SillyClass(return "ok", () -> {});
+}
+private class SillyClass {
+ public function new(d:Dynamic, f:Dynamic) {}