eliminate `lib` from ty crate
[hiphop-php.git] / hphp / hack / src / rupro / ty / typing_defs / decl.rs
blob1e024ce5d16663a41e7bb5ae191d642a88df66ad
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::decl_defs::{folded, DeclTy};
6 use crate::reason::Reason;
7 use pos::TypeName;
9 #[derive(Debug)]
10 pub struct ClassElt<R: Reason> {
11     ty: DeclTy<R>,
12     #[allow(dead_code)]
13     origin: TypeName,
16 impl<R: Reason> ClassElt<R> {
17     pub fn new(folded_elt: &folded::FoldedElement, ty: DeclTy<R>) -> Self {
18         Self {
19             ty,
20             origin: folded_elt.origin,
21         }
22     }
24     pub fn ty(&self) -> &DeclTy<R> {
25         &self.ty
26     }
28     pub fn pos(&self) -> &R::Pos {
29         self.ty.pos()
30     }