diff --git a/schala-lang/language/src/typechecking.rs b/schala-lang/language/src/typechecking.rs index 834601f..52b6dba 100644 --- a/schala-lang/language/src/typechecking.rs +++ b/schala-lang/language/src/typechecking.rs @@ -28,6 +28,7 @@ enum TConst { Int, Float, StringT, + Bool, } impl TConst { @@ -80,12 +81,17 @@ impl TypeContext { fn infer_expr_type(&mut self, expr_type: &ExpressionType) -> InferResult { use self::ExpressionType::*; - match expr_type { - NatLiteral(_) => Ok(MonoType::Const(TConst::Nat)), - FloatLiteral(_) => Ok(MonoType::Const(TConst::Float)), - StringLiteral(_) => Ok(MonoType::Const(TConst::StringT)), - _ => Ok(MonoType::Const(TConst::user("unimplemented"))) - } + Ok(match expr_type { + NatLiteral(_) => MonoType::Const(TConst::Nat), + FloatLiteral(_) => MonoType::Const(TConst::Float), + StringLiteral(_) => MonoType::Const(TConst::StringT), + BoolLiteral(_) => MonoType::Const(TConst::Bool), + _ => MonoType::Const(TConst::user("unimplemented")) + }) + } + + fn unify(t1: MonoType, t2: MonoType) -> InferResult { + unimplemented!() } }