From c68e09d89da80cb7bf6e904020904ba4d6a6f020 Mon Sep 17 00:00:00 2001 From: greg Date: Tue, 10 Oct 2017 02:32:02 -0700 Subject: [PATCH] Slight refactoring --- src/schala_lang/type_check.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/schala_lang/type_check.rs b/src/schala_lang/type_check.rs index 79394ac..0a21189 100644 --- a/src/schala_lang/type_check.rs +++ b/src/schala_lang/type_check.rs @@ -169,15 +169,17 @@ impl TypeContext { Ok(match (&expr.0, &expr.1) { (ref _t, &Some(ref anno)) => { - //TODO make this better, - self.from_anno(anno) + self.from_anno(anno)// TODO make this better, }, (&IntLiteral(_), _) => TConst(Integer), (&FloatLiteral(_), _) => TConst(Float), (&StringLiteral(_), _) => TConst(StringT), (&BoolLiteral(_), _) => TConst(Boolean), - (&Variable(ref name), _) => self.lookup(name).map(|entry| entry.type_var) - .ok_or(format!("Couldn't find {}", name))?, + (&Variable(ref name), _) => { + self.lookup(name) + .map(|entry| entry.type_var) + .ok_or(format!("Couldn't find {}", name))? + }, (&BinExp(ref op, box ref lhs, box ref rhs), _) => { let _f_type = self.infer_op(op); let _lhs_type = self.infer(&lhs);