Start adding call

This commit is contained in:
greg 2019-02-23 02:50:11 -08:00
parent e34295a6f7
commit b709cfd51a

View File

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