use super::with; #[derive(Copy, Clone, Debug)] pub struct Ty(pub usize); impl Ty { pub fn kind(&self) -> TyKind { with(|context| context.ty_kind(*self)) } } #[derive(Clone, Debug)] pub enum TyKind { RigidTy(RigidTy), } #[derive(Clone, Debug)] pub enum RigidTy { Bool, Char, Int(IntTy), Uint(UintTy), Float(FloatTy), Tuple(Vec), } #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum IntTy { Isize, I8, I16, I32, I64, I128, } #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum UintTy { Usize, U8, U16, U32, U64, U128, } #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum FloatTy { F32, F64, }