diff --git a/schala-lang/language/src/typechecking.rs b/schala-lang/language/src/typechecking.rs index 49ba798..08803a8 100644 --- a/schala-lang/language/src/typechecking.rs +++ b/schala-lang/language/src/typechecking.rs @@ -208,7 +208,15 @@ impl<'a> TypeContext<'a> { } } - fn decl(&mut self, _decl: &Declaration) -> InferResult { + fn decl(&mut self, decl: &Declaration) -> InferResult { + use self::Declaration::*; + match decl { + Binding { name, expr, .. } => { + let ty = self.expr(expr)?; + self.variable_map.insert(name.clone(), ty); + }, + _ => (), + } Ok(ty!(Unit)) }