Enforce Pos_or_decl.t in reasons for decl types
[hiphop-php.git] / hphp / hack / src / typing / type_visitor.mli
blob104668ae898c9dd25a636ee999f356ecd6e5b5ab
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_terr : 'a -> Typing_reason.decl_t -> 'a
16 method on_tmixed : '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_tvarray_or_darray :
25 'a ->
26 Typing_reason.decl_t ->
27 Typing_defs.decl_ty ->
28 Typing_defs.decl_ty ->
31 method on_tvec_or_dict :
32 'a ->
33 Typing_reason.decl_t ->
34 Typing_defs.decl_ty ->
35 Typing_defs.decl_ty ->
38 method on_tvarray : 'a -> Typing_reason.decl_t -> Typing_defs.decl_ty -> 'a
40 method on_tdarray :
41 'a ->
42 Typing_reason.decl_t ->
43 Typing_defs.decl_ty ->
44 Typing_defs.decl_ty ->
47 method on_tgeneric :
48 'a -> Typing_reason.decl_t -> string -> Typing_defs.decl_ty list -> 'a
50 method on_toption : 'a -> Typing_reason.decl_t -> Typing_defs.decl_ty -> 'a
52 method on_tlike : 'a -> Typing_reason.decl_t -> Typing_defs.decl_ty -> 'a
54 method on_tprim : 'a -> Typing_reason.decl_t -> Aast.tprim -> 'a
56 method on_tvar : 'a -> Typing_reason.decl_t -> Ident.t -> 'a
58 method on_type : 'a -> Typing_defs.decl_ty -> 'a
60 method on_tfun :
61 'a -> Typing_reason.decl_t -> Typing_defs.decl_fun_type -> 'a
63 method on_tapply :
64 'a ->
65 Typing_reason.decl_t ->
66 Ast_defs.id ->
67 Typing_defs.decl_ty list ->
70 method on_ttuple :
71 'a -> Typing_reason.decl_t -> Typing_defs.decl_ty list -> 'a
73 method on_tunion :
74 'a -> Typing_reason.decl_t -> Typing_defs.decl_ty list -> 'a
76 method on_tintersection :
77 'a -> Typing_reason.decl_t -> Typing_defs.decl_ty list -> 'a
79 method on_tshape :
80 'a ->
81 Typing_reason.decl_t ->
82 Typing_defs.shape_kind ->
83 Typing_defs.decl_phase Typing_defs.shape_field_type
84 Typing_defs.TShapeMap.t ->
87 method on_taccess :
88 'a ->
89 Typing_reason.decl_t ->
90 Typing_defs.decl_phase Typing_defs.taccess_type ->
92 end
94 class virtual ['a] decl_type_visitor : ['a] decl_type_visitor_type
96 class type ['a] locl_type_visitor_type =
97 object
98 method on_tany : 'a -> Typing_reason.t -> 'a
100 method on_terr : 'a -> Typing_reason.t -> 'a
102 method on_tnonnull : 'a -> Typing_reason.t -> 'a
104 method on_tdynamic : 'a -> Typing_reason.t -> 'a
106 method on_toption : 'a -> Typing_reason.t -> Typing_defs.locl_ty -> 'a
108 method on_tprim : 'a -> Typing_reason.t -> Aast.tprim -> 'a
110 method on_tvar : 'a -> Typing_reason.t -> Ident.t -> 'a
112 method on_type : 'a -> Typing_defs.locl_ty -> 'a
114 method on_tfun : 'a -> Typing_reason.t -> Typing_defs.locl_fun_type -> 'a
116 method on_tgeneric :
117 'a -> Typing_reason.t -> string -> Typing_defs.locl_ty list -> 'a
119 method on_tnewtype :
120 'a ->
121 Typing_reason.t ->
122 string ->
123 Typing_defs.locl_ty list ->
124 Typing_defs.locl_ty ->
127 method on_tdependent :
128 'a ->
129 Typing_reason.t ->
130 Typing_defs.dependent_type ->
131 Typing_defs.locl_ty ->
134 method on_ttuple : '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_tunion : 'a -> Typing_reason.t -> Typing_defs.locl_ty list -> 'a
143 method on_tintersection :
144 'a -> Typing_reason.t -> Typing_defs.locl_ty list -> 'a
146 method on_tobject : 'a -> Typing_reason.t -> 'a
148 method on_tvarray_or_darray :
149 'a -> Typing_reason.t -> Typing_defs.locl_ty -> Typing_defs.locl_ty -> 'a
151 method on_tvec_or_dict :
152 'a -> Typing_reason.t -> Typing_defs.locl_ty -> Typing_defs.locl_ty -> 'a
154 method on_tvarray : 'a -> Typing_reason.t -> Typing_defs.locl_ty -> 'a
156 method on_tdarray :
157 'a -> Typing_reason.t -> Typing_defs.locl_ty -> Typing_defs.locl_ty -> 'a
159 method on_tshape :
160 'a ->
161 Typing_reason.t ->
162 Typing_defs.shape_kind ->
163 Typing_defs.locl_phase Typing_defs.shape_field_type
164 Typing_defs.TShapeMap.t ->
167 method on_tclass :
168 'a ->
169 Typing_reason.t ->
170 Ast_defs.id ->
171 Typing_defs.exact ->
172 Typing_defs.locl_ty list ->
175 method on_tlist : 'a -> Typing_reason.t -> Typing_defs.locl_ty list -> 'a
177 method on_tunapplied_alias : 'a -> Typing_reason.t -> string -> 'a
179 method on_taccess :
180 'a ->
181 Typing_reason.t ->
182 Typing_defs.locl_phase Typing_defs.taccess_type ->
186 class virtual ['a] locl_type_visitor : ['a] locl_type_visitor_type
188 class type ['a] internal_type_visitor_type =
189 object
190 inherit ['a] locl_type_visitor_type
192 method on_internal_type : 'a -> Typing_defs.internal_type -> 'a
194 method on_constraint_type : 'a -> Typing_defs.constraint_type -> 'a
196 method on_locl_type : 'a -> Typing_defs.locl_ty -> 'a
198 method on_locl_type_list : 'a -> Typing_defs.locl_ty list -> 'a
200 method on_locl_type_option : 'a -> Typing_defs.locl_ty option -> 'a
202 method on_thas_member :
203 'a -> Typing_reason.t -> Typing_defs.has_member -> 'a
205 method on_has_member : 'a -> Typing_reason.t -> Typing_defs.has_member -> 'a
207 method on_tdestructure :
208 'a -> Typing_reason.t -> Typing_defs.destructure -> 'a
210 method on_destructure :
211 'a -> Typing_reason.t -> Typing_defs.destructure -> 'a
213 method on_tcunion :
214 'a ->
215 Typing_reason.t ->
216 Typing_defs.locl_ty ->
217 Typing_defs.constraint_type ->
220 method on_tcintersection :
221 'a ->
222 Typing_reason.t ->
223 Typing_defs.locl_ty ->
224 Typing_defs.constraint_type ->
228 class ['a] internal_type_visitor : ['a] internal_type_visitor_type