From 5bac01cf206c1f77c652a5b2bfbc7b90f257bfad Mon Sep 17 00:00:00 2001 From: greg Date: Sat, 23 Feb 2019 03:55:46 -0800 Subject: [PATCH] More boilerplate for apply --- schala-lang/language/src/typechecking.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/schala-lang/language/src/typechecking.rs b/schala-lang/language/src/typechecking.rs index 4394366..7d17108 100644 --- a/schala-lang/language/src/typechecking.rs +++ b/schala-lang/language/src/typechecking.rs @@ -337,12 +337,15 @@ impl<'a> TypeContext<'a> { println!("ARGUMENT TYPES: {:?}", argument_types); + //TODO finish this Ok(ty!(UserDefined)) } fn call(&mut self, f: &Expression, args: &Vec>) -> InferResult { - - Ok(ty!(UserDefined)) + let tf = self.expr(f)?; + let arg_types: InferResult> = args.iter().map(|ex| self.expr(ex.node())).collect(); + let arg_types = arg_types?; + self.handle_apply(tf, arg_types) } fn handle_apply(&mut self, tf: Type, args: Vec) -> InferResult {