sync the repo
[hiphop-php.git] / hphp / hack / src / typing / type_visitor.mli
blob718898251425afad3ac86efb39ffe38bf29af7ce
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 class type ['a] decl_type_visitor_type =
11 object
12 method on_tany : 'a -> Typing_reason.decl_t -> 'a
14 method on_tmixed : 'a -> Typing_reason.decl_t -> 'a
16 method on_twildcard : 'a -> Typing_reason.decl_t -> 'a
18 method on_tnonnull : 'a -> Typing_reason.decl_t -> 'a
20 method on_tdynamic : 'a -> Typing_reason.decl_t -> 'a
22 method on_tthis : 'a -> Typing_reason.decl_t -> 'a
24 method on_tvec_or_dict :
25 'a ->
26 Typing_reason.decl_t ->
27 Typing_defs.decl_ty ->
28 Typing_defs.decl_ty ->
31 method on_tgeneric :
32 'a -> Typing_reason.decl_t -> string -> Typing_defs.decl_ty list -> 'a
34 method on_toption : 'a -> Typing_reason.decl_t -> Typing_defs.decl_ty -> 'a
36 method on_tlike : 'a -> Typing_reason.decl_t -> Typing_defs.decl_ty -> 'a
38 method on_tprim : 'a -> Typing_reason.decl_t -> Aast.tprim -> 'a
40 method on_tvar : 'a -> Typing_reason.decl_t -> Tvid.t -> 'a
42 method on_type : 'a -> Typing_defs.decl_ty -> 'a
44 method on_tfun :
45 'a -> Typing_reason.decl_t -> Typing_defs.decl_fun_type -> 'a
47 method on_tapply :
48 'a ->
49 Typing_reason.decl_t ->
50 Typing_defs.pos_id ->
51 Typing_defs.decl_ty list ->
54 method on_ttuple :
55 'a -> Typing_reason.decl_t -> Typing_defs.decl_ty list -> 'a
57 method on_tunion :
58 'a -> Typing_reason.decl_t -> Typing_defs.decl_ty list -> 'a
60 method on_tintersection :
61 'a -> Typing_reason.decl_t -> Typing_defs.decl_ty list -> 'a
63 method on_tshape :
64 'a ->
65 Typing_reason.decl_t ->
66 Typing_defs.decl_phase Typing_defs.shape_type ->
69 method on_taccess :
70 'a ->
71 Typing_reason.decl_t ->
72 Typing_defs.decl_phase Typing_defs.taccess_type ->
75 method on_trefinement :
76 'a ->
77 Typing_reason.decl_t ->
78 Typing_defs.decl_ty ->
79 Typing_defs.decl_class_refinement ->
82 method on_tnewtype :
83 'a ->
84 Typing_reason.decl_t ->
85 string ->
86 Typing_defs.decl_ty list ->
87 Typing_defs.decl_ty ->
89 end
91 class virtual ['a] decl_type_visitor : ['a] decl_type_visitor_type
93 class type ['a] locl_type_visitor_type =
94 object
95 method on_tany : 'a -> Typing_reason.t -> 'a
97 method on_tnonnull : 'a -> Typing_reason.t -> 'a
99 method on_tdynamic : 'a -> Typing_reason.t -> 'a
101 method on_toption : 'a -> Typing_reason.t -> Typing_defs.locl_ty -> 'a
103 method on_tprim : 'a -> Typing_reason.t -> Aast.tprim -> 'a
105 method on_tvar : 'a -> Typing_reason.t -> Tvid.t -> 'a
107 method on_type : 'a -> Typing_defs.locl_ty -> 'a
109 method on_tfun : 'a -> Typing_reason.t -> Typing_defs.locl_fun_type -> 'a
111 method on_tgeneric :
112 'a -> Typing_reason.t -> string -> Typing_defs.locl_ty list -> 'a
114 method on_tnewtype :
115 'a ->
116 Typing_reason.t ->
117 string ->
118 Typing_defs.locl_ty list ->
119 Typing_defs.locl_ty ->
122 method on_tdependent :
123 'a ->
124 Typing_reason.t ->
125 Typing_defs.dependent_type ->
126 Typing_defs.locl_ty ->
129 method on_ttuple : 'a -> Typing_reason.t -> Typing_defs.locl_ty list -> 'a
131 method on_tunion : 'a -> Typing_reason.t -> Typing_defs.locl_ty list -> 'a
133 method on_tintersection :
134 'a -> Typing_reason.t -> Typing_defs.locl_ty list -> 'a
136 method on_tunion : 'a -> Typing_reason.t -> Typing_defs.locl_ty list -> 'a
138 method on_tintersection :
139 'a -> Typing_reason.t -> Typing_defs.locl_ty list -> 'a
141 method on_tvec_or_dict :
142 'a -> Typing_reason.t -> Typing_defs.locl_ty -> Typing_defs.locl_ty -> 'a
144 method on_tshape :
145 'a ->
146 Typing_reason.t ->
147 Typing_defs.locl_phase Typing_defs.shape_type ->
150 method on_tclass :
151 'a ->
152 Typing_reason.t ->
153 Typing_defs.pos_id ->
154 Typing_defs.exact ->
155 Typing_defs.locl_ty list ->
158 method on_class_refinement : 'a -> Typing_defs.locl_class_refinement -> 'a
160 method on_tlist : 'a -> Typing_reason.t -> Typing_defs.locl_ty list -> 'a
162 method on_tunapplied_alias : 'a -> Typing_reason.t -> string -> 'a
164 method on_taccess :
165 'a ->
166 Typing_reason.t ->
167 Typing_defs.locl_phase Typing_defs.taccess_type ->
170 method on_neg_type : 'a -> Typing_reason.t -> Typing_defs.neg_type -> 'a
172 method on_tlabel : 'a -> Typing_reason.t -> string -> 'a
175 class virtual ['a] locl_type_visitor : ['a] locl_type_visitor_type
177 class type ['a] internal_type_visitor_type =
178 object
179 inherit ['a] locl_type_visitor_type
181 method on_internal_type : 'a -> Typing_defs.internal_type -> 'a
183 method on_constraint_type : 'a -> Typing_defs.constraint_type -> 'a
185 method on_locl_type : 'a -> Typing_defs.locl_ty -> 'a
187 method on_locl_type_list : 'a -> Typing_defs.locl_ty list -> 'a
189 method on_locl_type_option : 'a -> Typing_defs.locl_ty option -> 'a
191 method on_thas_member :
192 'a -> Typing_reason.t -> Typing_defs.has_member -> 'a
194 method on_has_member : 'a -> Typing_reason.t -> Typing_defs.has_member -> 'a
196 method on_thas_type_member :
197 'a -> Typing_reason.t -> Typing_defs.has_type_member -> 'a
199 method on_has_type_member :
200 'a -> Typing_reason.t -> Typing_defs.has_type_member -> 'a
202 method on_tcan_index : 'a -> Typing_reason.t -> Typing_defs.can_index -> 'a
204 method on_tcan_traverse :
205 'a -> Typing_reason.t -> Typing_defs.can_traverse -> 'a
207 method on_can_index : 'a -> Typing_reason.t -> Typing_defs.can_index -> 'a
209 method on_can_traverse :
210 'a -> Typing_reason.t -> Typing_defs.can_traverse -> 'a
212 method on_tdestructure :
213 'a -> Typing_reason.t -> Typing_defs.destructure -> 'a
215 method on_destructure :
216 'a -> Typing_reason.t -> Typing_defs.destructure -> 'a
218 method on_tcunion :
219 'a ->
220 Typing_reason.t ->
221 Typing_defs.locl_ty ->
222 Typing_defs.constraint_type ->
225 method on_tcintersection :
226 'a ->
227 Typing_reason.t ->
228 Typing_defs.locl_ty ->
229 Typing_defs.constraint_type ->
232 method on_ttype_switch :
233 'a ->
234 Typing_reason.t ->
235 Typing_defs.type_predicate ->
236 Typing_defs.locl_ty ->
237 Typing_defs.locl_ty ->
240 method on_thas_const :
241 'a -> Typing_reason.t -> string -> Typing_defs.locl_ty -> 'a
244 class ['a] internal_type_visitor : ['a] internal_type_visitor_type