2023-04-24 01:04:44 +00:00
|
|
|
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))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-05 18:50:13 -03:00
|
|
|
#[derive(Clone, Debug)]
|
2023-04-24 01:04:44 +00:00
|
|
|
pub enum TyKind {
|
2023-06-28 11:31:28 -03:00
|
|
|
RigidTy(RigidTy),
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-05 18:50:13 -03:00
|
|
|
#[derive(Clone, Debug)]
|
2023-06-28 11:31:28 -03:00
|
|
|
pub enum RigidTy {
|
2023-04-24 01:04:44 +00:00
|
|
|
Bool,
|
2023-07-05 19:01:11 -03:00
|
|
|
Char,
|
2023-04-24 01:04:44 +00:00
|
|
|
Tuple(Vec<Ty>),
|
|
|
|
|
}
|