diff --git a/schala-lang/language/src/typechecking.rs b/schala-lang/language/src/typechecking.rs index bf6a56a..834601f 100644 --- a/schala-lang/language/src/typechecking.rs +++ b/schala-lang/language/src/typechecking.rs @@ -8,7 +8,7 @@ pub struct TypeContext { } -type TypeResult = Result; +type InferResult = Result; #[derive(Debug, Clone)] struct TypeError { } @@ -56,7 +56,7 @@ impl TypeContext { } impl TypeContext { - fn infer_ast(&mut self, ast: &AST) -> TypeResult { + fn infer_ast(&mut self, ast: &AST) -> InferResult { let mut output = MonoType::Const(TConst::Unit); for statement in ast.0.iter() { output = match statement { @@ -67,18 +67,18 @@ impl TypeContext { Ok(output) } - fn infer_expr(&mut self, expr: &Expression) -> TypeResult { + fn infer_expr(&mut self, expr: &Expression) -> InferResult { match expr { Expression(expr_type, Some(type_anno)) => unimplemented!(), Expression(expr_type, None) => self.infer_expr_type(expr_type) } } - fn infer_decl(&mut self, expr: &Declaration) -> TypeResult { + fn infer_decl(&mut self, expr: &Declaration) -> InferResult { Ok(MonoType::Const(TConst::user("unimplemented"))) } - fn infer_expr_type(&mut self, expr_type: &ExpressionType) -> TypeResult { + fn infer_expr_type(&mut self, expr_type: &ExpressionType) -> InferResult { use self::ExpressionType::*; match expr_type { NatLiteral(_) => Ok(MonoType::Const(TConst::Nat)),