2 * Copyright (c) 2015, 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 (*****************************************************************************)
15 (*****************************************************************************)
19 (*****************************************************************************)
20 (* Builds a substitution out of a list of type parameters and a list of types.
24 * class X extends Y<int>
26 * To build the type of X, we to replace all the occurrences of T in Y by int.
27 * The function make_subst, builds the substition (the map associating types
28 * to a type parameter name), in this case, it would build the map(T => int).
30 (*****************************************************************************)
32 val make_subst
: decl tparam list
-> decl ty list
-> subst
34 (*****************************************************************************)
35 (* Primitive instantiating a type.
36 * TODO: explain what instantiation is about.
38 (*****************************************************************************)
40 val instantiate
: subst
-> decl ty
-> decl ty
41 val instantiate_ce
: subst
-> class_elt
-> class_elt
42 val instantiate_typeconst
:
43 subst
-> typeconst_type
-> typeconst_type