diff --git a/schala-lang/language/src/typechecking.rs b/schala-lang/language/src/typechecking.rs index 39cbe5d..7a71f3e 100644 --- a/schala-lang/language/src/typechecking.rs +++ b/schala-lang/language/src/typechecking.rs @@ -7,7 +7,7 @@ pub type TypeName = Rc; pub struct TypeContext<'a> { variable_map: ScopeStack<'a, Rc, ()>, - evar_count: u32 + //evar_count: u32 } /// `InferResult` is the monad in which type inference takes place. @@ -41,10 +41,6 @@ pub enum TypeConst { } impl Type { - fn arrow(a: Type, b: Type) -> Type { - Type::Arrow(Box::new(a), Box::new(b)) - } - fn to_string(&self) -> String { use self::Type::*; use self::TypeConst::*; @@ -150,7 +146,7 @@ impl<'a> TypeContext<'a> { pub fn new() -> TypeContext<'a> { TypeContext { variable_map: ScopeStack::new(None), - evar_count: 0 + //evar_count: 0 } } @@ -188,6 +184,8 @@ impl<'a> TypeContext<'a> { Ok(match expr { NatLiteral(_) => Type::Const(TypeConst::Nat), BoolLiteral(_) => Type::Const(TypeConst::Bool), + FloatLiteral(_) => Type::Const(TypeConst::Float), + StringLiteral(_) => Type::Const(TypeConst::StringT), _ => Type::Const(TypeConst::Unit) }) }