Variables

This commit is contained in:
greg 2019-02-19 21:41:07 -08:00
parent 866c9211f9
commit 6012bd1087

View File

@ -208,7 +208,15 @@ impl<'a> TypeContext<'a> {
}
}
fn decl(&mut self, _decl: &Declaration) -> InferResult<Type> {
fn decl(&mut self, decl: &Declaration) -> InferResult<Type> {
use self::Declaration::*;
match decl {
Binding { name, expr, .. } => {
let ty = self.expr(expr)?;
self.variable_map.insert(name.clone(), ty);
},
_ => (),
}
Ok(ty!(Unit))
}