From f88d2331e30b4d95eef033191256455d9e7b8368 Mon Sep 17 00:00:00 2001 From: greg Date: Wed, 23 May 2018 02:38:13 -0700 Subject: [PATCH] printf debugs for problems with function typing --- schala-lang/src/typechecking.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/schala-lang/src/typechecking.rs b/schala-lang/src/typechecking.rs index 5e5fb29..75d1b7e 100644 --- a/schala-lang/src/typechecking.rs +++ b/schala-lang/src/typechecking.rs @@ -257,14 +257,17 @@ impl<'a> Infer<'a> { let mut arg_types: Vec = Vec::new(); for (param_name, maybe_type) in params { + println!("HANDLING PARAM: {}", param_name); let tau = local_infer.fresh(); let sigma = PolyType(HashSet::new(), tau); local_infer.env.extend(param_name, sigma); } let ret_type = local_infer.block(block)?; + println!("RET TYPE: {:?}", ret_type); let mut final_type = MonoType::Function(Box::new(MonoType::Const(TypeConst::Unit)), Box::new(ret_type)); + println!("ARG TYPES: {:?}", arg_types); for ty in arg_types.into_iter().rev() { final_type = MonoType::Function(Box::new(ty), Box::new(final_type)); @@ -308,6 +311,12 @@ impl<'a> Infer<'a> { let tau = self.instantiate(sigma); tau }, + Call { f, arguments } => { + /* + let sigma = match sel + */ + unimplemented!() + }, e => return Err(InferError::Custom(format!("this expression type not done yet: {:?}", e))) }) }