From d040d76bfa6460962fbcd9d82ecead9367734f3e Mon Sep 17 00:00:00 2001 From: greg Date: Mon, 21 May 2018 20:57:51 -0700 Subject: [PATCH] Start handling function case --- schala-lang/src/typechecking.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/schala-lang/src/typechecking.rs b/schala-lang/src/typechecking.rs index af85756..9c86856 100644 --- a/schala-lang/src/typechecking.rs +++ b/schala-lang/src/typechecking.rs @@ -242,12 +242,20 @@ impl<'a> Infer<'a> { fn infer_declaration(&mut self, decl: &parsing::Declaration) -> InferResult { use parsing::Declaration::*; + use parsing::Signature; match decl { Binding { name, expr, .. } => { let tau: MonoType = self.infer_expression(&expr)?; let sigma = self.generalize(tau); self.env.extend(name, sigma); }, + FuncDecl(Signature { name, params, type_anno }, block) => { + //TODO fill in here + + + + return Err(InferError::Custom(format!("This decl not yet supported"))) + }, _ => return Err(InferError::Custom(format!("This decl not yet supported"))) } Ok(MonoType::Const(TypeConst::Unit))