This commit is contained in:
Michael Zhang 2023-11-30 00:17:28 -06:00
parent f479cf0420
commit 6012067fa5

View file

@ -226,7 +226,7 @@ impl Monotype {
}
}
#[derive(Debug, Clone)]
#[derive(Clone)]
pub enum ContextEntry {
TypeVar,
TermAnnot(Type),
@ -235,6 +235,20 @@ pub enum ContextEntry {
Marker,
}
impl fmt::Debug for ContextEntry {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::TypeVar => write!(f, "Ty"),
Self::TermAnnot(arg0) => f.debug_tuple("Annot").field(arg0).finish(),
Self::ExistentialVar => write!(f, "ExVar"),
Self::ExistentialSolved(arg0) => {
f.debug_tuple("ExSolv").field(arg0).finish()
}
Self::Marker => write!(f, ""),
}
}
}
#[derive(Debug, Clone)]
pub enum CompleteContextEntry {
TypeVar(String),
@ -243,12 +257,18 @@ pub enum CompleteContextEntry {
Marker(String),
}
#[derive(Debug, Clone)]
#[derive(Clone)]
pub struct Context {
// TODO: Make this not pub(crate)
pub(crate) vector: Vector<ContextEntry>,
}
impl fmt::Debug for Context {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{:?}", self.vector)
}
}
// impl fmt::Debug for Context {
// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
// f.write_str("Γ")?;