Introduce __ReturnsVoidToRx
[hiphop-php.git] / hphp / hack / src / typing / typing_func_terminality.ml
blob070abbe65aef021729c53797d5772528df92119a
1 (**
2 * Copyright (c) 2015, Facebook, Inc.
3 * All rights reserved.
5 * This source code is licensed under the MIT license found in the
6 * LICENSE file in the "hack" directory of this source tree.
8 *)
10 module TLazyHeap = Typing_lazy_heap
12 (* Not adding a Typing_dep here because it will be added when the
13 * Nast is fully processed (by the caller of this code) *)
14 let get_fun = TLazyHeap.get_fun
16 let get_static_meth tcopt (cls_name:string) (meth_name:string) =
17 match TLazyHeap.get_class tcopt cls_name with
18 | None -> None
19 | Some { Typing_defs.tc_smethods ; _ } ->
20 begin match SMap.get meth_name tc_smethods with
21 | None -> None
22 | Some { Typing_defs.ce_type = lazy (_r, Typing_defs.Tfun fty) ; _} ->
23 Some fty
24 | Some _ -> None
25 end
27 let raise_exit_if_terminal = function
28 | None -> ()
29 | Some ({ Typing_defs.ft_ret = (_r, Typing_defs.Tprim Nast.Tnoreturn); _})
30 -> raise Exit
31 | Some _ -> ()