2 * Copyright (c) 2017, Facebook, Inc.
5 * This source code is licensed under the BSD-style license found in the
6 * LICENSE file in the "hack" directory of this source tree. An additional grant
7 * of patent rights can be found in the PATENTS file in the same directory.
13 let kind_to_type_info ~tparams ~namespace k
=
15 | Ast.Alias h
| Ast.NewType h
->
16 Emit_type_hint.hint_to_type_info
17 ~skipawaitable
:false ~nullable
:false
18 ~always_extended
:false ~tparams ~namespace h
20 let emit_typedef : Ast.typedef
-> Hhas_typedef.t
=
22 let namespace = ast_typedef
.Ast.t_namespace
in
24 Hhbc_id.Class.elaborate_id
namespace ast_typedef
.Ast.t_id
in
25 let tparams = Emit_body.tparams_to_strings ast_typedef
.Ast.t_tparams
in
26 let typedef_type_info =
27 kind_to_type_info ~
tparams ~
namespace ast_typedef
.Ast.t_kind
in
32 let emit_typedefs_from_program ast
=
34 (fun d
-> match d
with Ast.Typedef td
-> Some
(emit_typedef td
) | _
-> None
)