1 // Copyright (c) Facebook, Inc. and its affiliates.
3 // This source code is licensed under the MIT license found in the
4 // LICENSE file in the "hack" directory of this source tree.
6 // @generated SignedSource<<ba056df1b5addc42c4f6034ccb8b3bc5>>
8 // To regenerate this file, run:
9 // hphp/hack/src/oxidized/regen.sh
11 use ocamlrep_derive::IntoOcamlRep;
23 pub use crate::typing_reason as reason;
25 #[derive(Clone, Debug, IntoOcamlRep)]
32 #[derive(Clone, Debug, IntoOcamlRep)]
38 #[derive(Clone, Debug, IntoOcamlRep)]
39 pub struct Ty(pub reason::Reason, pub Box<Ty_>);
41 #[derive(Clone, Debug, IntoOcamlRep)]
42 pub struct ShapeFieldType {
47 #[derive(Clone, Debug, IntoOcamlRep)]
50 Tapply(nast::Sid, Vec<Ty>),
53 Tarray(Option<Ty>, Option<Ty>),
68 Tshape(ShapeKind, nast::shape_map::ShapeMap<ShapeFieldType>),
71 #[derive(Clone, Debug, IntoOcamlRep)]
82 #[derive(Clone, Debug, IntoOcamlRep)]
83 pub enum AbstractKind {
84 AKnewtype(String, Vec<Ty>),
86 AKdependent(DependentType),
89 #[derive(Clone, Debug, IntoOcamlRep)]
90 pub enum DependentType {
96 #[derive(Clone, Debug, IntoOcamlRep)]
97 pub struct TaccessType(pub Ty, pub Vec<nast::Sid>);
99 #[derive(Clone, Debug, IntoOcamlRep)]
105 #[derive(Clone, Debug, IntoOcamlRep)]
106 pub enum Reactivity {
110 Reactive(Option<Ty>),
111 MaybeReactive(Box<Reactivity>),
112 RxVar(Option<Box<Reactivity>>),
115 #[derive(Clone, Debug, IntoOcamlRep)]
122 #[derive(Clone, Debug, IntoOcamlRep)]
123 pub enum ParamMutability {
125 ParamBorrowedMutable,
129 #[derive(Clone, Debug, IntoOcamlRep)]
130 pub enum FunTparamsKind {
132 FTKinstantiatedTargs,
135 #[derive(Clone, Debug, IntoOcamlRep)]
138 pub deprecated: Option<String>,
140 pub is_coroutine: bool,
142 pub tparams: (Vec<Tparam>, FunTparamsKind),
143 pub where_constraints: Vec<WhereConstraint>,
144 pub params: FunParams,
145 pub ret: PossiblyEnforcedTy,
146 pub fun_kind: ast_defs::FunKind,
147 pub reactive: Reactivity,
148 pub return_disposable: bool,
149 pub mutability: Option<ParamMutability>,
150 pub returns_mutable: bool,
151 pub decl_errors: Option<errors::Errors>,
152 pub returns_void_to_rx: bool,
155 #[derive(Clone, Debug, IntoOcamlRep)]
157 Fstandard(isize, isize),
158 Fvariadic(isize, FunParam),
159 Fellipsis(isize, pos::Pos),
162 #[derive(Clone, Debug, IntoOcamlRep)]
169 #[derive(Clone, Debug, IntoOcamlRep)]
170 pub enum ParamRxAnnotation {
175 #[derive(Clone, Debug, IntoOcamlRep)]
176 pub struct PossiblyEnforcedTy {
181 #[derive(Clone, Debug, IntoOcamlRep)]
182 pub struct FunParam {
184 pub name: Option<String>,
185 pub type_: PossiblyEnforcedTy,
187 pub accept_disposable: bool,
188 pub mutability: Option<ParamMutability>,
189 pub rx_annotation: Option<ParamRxAnnotation>,
192 pub type FunParams = Vec<FunParam>;
194 #[derive(Clone, Debug, IntoOcamlRep)]
195 pub enum XhpAttrTag {
200 #[derive(Clone, Debug, IntoOcamlRep)]
202 pub tag: Option<XhpAttrTag>,
203 pub has_default: bool,
206 #[derive(Clone, Debug, IntoOcamlRep)]
207 pub struct ClassElt {
210 pub xhp_attr: Option<XhpAttr>,
213 pub memoizelsb: bool,
214 pub synthesized: bool,
215 pub visibility: Visibility,
218 pub type_: lazy::Lazy<Ty>,
222 #[derive(Clone, Debug, IntoOcamlRep)]
223 pub struct ClassConst {
224 pub synthesized: bool,
228 pub visibility: Visibility,
229 pub expr: Option<nast::Expr>,
233 #[derive(Clone, Debug, IntoOcamlRep)]
234 pub struct Requirement(pub pos::Pos, pub Ty);
236 #[derive(Clone, Debug, IntoOcamlRep)]
237 pub enum ConsistentKind {
243 #[derive(Clone, Debug, IntoOcamlRep)]
244 pub struct ClassType {
246 pub members_fully_known: bool,
251 pub deferred_init_members: s_set::SSet,
252 pub kind: ast_defs::ClassKind,
254 pub is_disposable: bool,
257 pub tparams: Vec<Tparam>,
258 pub where_constraints: Vec<WhereConstraint>,
259 pub consts: s_map::SMap<ClassConst>,
260 pub typeconsts: s_map::SMap<TypeconstType>,
261 pub props: s_map::SMap<ClassElt>,
262 pub sprops: s_map::SMap<ClassElt>,
263 pub methods: s_map::SMap<ClassElt>,
264 pub smethods: s_map::SMap<ClassElt>,
265 pub construct: (Option<ClassElt>, ConsistentKind),
266 pub ancestors: s_map::SMap<Ty>,
267 pub req_ancestors: Vec<Requirement>,
268 pub req_ancestors_extends: s_set::SSet,
269 pub extends: s_set::SSet,
270 pub enum_type: Option<EnumType>,
271 pub sealed_whitelist: Option<s_set::SSet>,
272 pub decl_errors: Option<errors::Errors>,
275 #[derive(Clone, Debug, IntoOcamlRep)]
276 pub enum TypeconstAbstractKind {
277 TCAbstract(Option<Ty>),
282 #[derive(Clone, Debug, IntoOcamlRep)]
283 pub struct TypeconstType {
284 pub abstract_: TypeconstAbstractKind,
285 pub visibility: Visibility,
287 pub constraint: Option<Ty>,
288 pub type_: Option<Ty>,
290 pub enforceable: (pos::Pos, bool),
291 pub reifiable: Option<pos::Pos>,
294 #[derive(Clone, Debug, IntoOcamlRep)]
295 pub struct EnumType {
297 pub constraint: Option<Ty>,
300 #[derive(Clone, Debug, IntoOcamlRep)]
301 pub struct TypedefType {
303 pub vis: aast::TypedefVisibility,
304 pub tparams: Vec<Tparam>,
305 pub constraint: Option<Ty>,
307 pub decl_errors: Option<errors::Errors>,
310 #[derive(Clone, Debug, IntoOcamlRep)]
312 pub variance: ast_defs::Variance,
313 pub name: ast_defs::Id,
314 pub constraints: Vec<(ast_defs::ConstraintKind, Ty)>,
315 pub reified: aast::ReifyKind,
316 pub user_attributes: Vec<nast::UserAttribute>,
319 #[derive(Clone, Debug, IntoOcamlRep)]
320 pub struct WhereConstraint(pub Ty, pub ast_defs::ConstraintKind, pub Ty);
322 #[derive(Clone, Debug, IntoOcamlRep)]
323 pub enum DeserializationError {
325 NotSupported(String),
326 DeserializationError(String),