Start adding call

This commit is contained in:
greg 2019-02-23 02:50:11 -08:00
parent e34295a6f7
commit b709cfd51a
1 changed files with 6 additions and 0 deletions

View File

@ -274,6 +274,7 @@ impl<'a> TypeContext<'a> {
BinExp(op, lhs, rhs) => self.binexp(op, lhs.node(), rhs.node())?,
IfExpression { discriminator, body } => self.if_expr(discriminator, body)?,
Value(val) => self.handle_value(val)?,
Call { box ref f, arguments } => self.call(f.node(), arguments)?,
Lambda { params, type_anno, body } => self.lambda(params, type_anno, body)?,
_ => ty!(Unit),
})
@ -346,6 +347,11 @@ impl<'a> TypeContext<'a> {
Ok(ty!(UserDefined))
}
fn call(&mut self, f: &Expression, args: &Vec<Meta<Expression>>) -> InferResult<Type> {
Ok(ty!(UserDefined))
}
fn block(&mut self, block: &Block) -> InferResult<Type> {
let mut output = ty!(Unit);
for s in block.iter() {