Variables
This commit is contained in:
parent
866c9211f9
commit
6012bd1087
@ -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))
|
Ok(ty!(Unit))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user