From e7103b925b7ad450abdf4f40571feef0b7ae4213 Mon Sep 17 00:00:00 2001 From: greg Date: Thu, 22 Feb 2018 03:25:05 -0800 Subject: [PATCH] type of a declaration should be Void, not Unit I think this makes sense Also kill some compiler warnings --- src/schala_lang/typechecking.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/schala_lang/typechecking.rs b/src/schala_lang/typechecking.rs index 53cc04d..424bfa0 100644 --- a/src/schala_lang/typechecking.rs +++ b/src/schala_lang/typechecking.rs @@ -56,7 +56,7 @@ impl TypeContext { }, _ => return Err(format!("other formats not done")) } - Ok(Unit) + Ok(Void) } fn type_infer(&mut self, expr: &parsing::Expression) -> TypeResult { use self::parsing::Expression; @@ -81,7 +81,7 @@ impl TypeContext { } } fn type_from_anno(&mut self, anno: &parsing::TypeName) -> TypeResult { - use self::parsing::{TypeName, TypeSingletonName}; + use self::parsing::TypeSingletonName; use self::parsing::TypeName::*; use self::Type::*; use self::TConst::*; Ok(match anno { @@ -98,7 +98,7 @@ impl TypeContext { }) } fn unify(&mut self, t1: Type, t2: Type) -> TypeResult { - use self::Type::*; use self::TConst::*; + use self::Type::*;// use self::TConst::*; match (t1, t2) { (Const(ref a), Const(ref b)) if a == b => Ok(Const(a.clone())), (a, b) => Err(format!("Types {:?} and {:?} don't unify", a, b))