Merge Typing_logic.Coerce and Typing_logic.IsSubtype
[hiphop-php.git] / hphp / hack / src / rupro / ty / lib / typing_error / error_primary.rs
blobf9161afd443b8fcce401a82b1ccaba5d4bfe7e9d
1 // Copyright (c) Facebook, Inc. and its affiliates.
2 //
3 // This source code is licensed under the MIT license found in the
4 // LICENSE file in the "hack" directory of this source tree.
5 use crate::reason::Reason;
6 use eq_modulo_pos::EqModuloPos;
7 use pos::TypeName;
8 use serde::{Deserialize, Serialize};
10 #[derive(Clone, Debug, Eq, EqModuloPos, Hash, PartialEq, Serialize, Deserialize)]
11 #[serde(bound = "R: Reason")]
12 pub enum Primary<R: Reason> {
13     InvalidTypeHint(R::Pos),
14     ExpectingTypeHint(R::Pos),
15     ExpectingReturnTypeHint(R::Pos),
16     CyclicClassDef(R::Pos, Vec<TypeName>),
17     WrongExtendKind {
18         parent_pos: R::Pos,
19         parent_kind: oxidized::ast_defs::ClassishKind,
20         parent_name: TypeName,
21         pos: R::Pos,
22         kind: oxidized::ast_defs::ClassishKind,
23         name: TypeName,
24     },