From d735e4568827d0fb8ddd9099fd286b2cc95d9609 Mon Sep 17 00:00:00 2001 From: greg Date: Tue, 10 Oct 2017 21:51:45 -0700 Subject: [PATCH] String and () types --- src/schala_lang/type_check.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/schala_lang/type_check.rs b/src/schala_lang/type_check.rs index ad774b1..3720294 100644 --- a/src/schala_lang/type_check.rs +++ b/src/schala_lang/type_check.rs @@ -152,10 +152,17 @@ impl TypeContext { match name.as_ref().as_ref() { "Int" => TConst(Integer), "Bool" => TConst(Boolean), + "String" => TConst(StringT), _ => self.get_existential_type() } }, - _ => TConst(Bottom) + &TypeName::Tuple(ref items) => { + if items.len() == 1 { + TConst(Unit) + } else { + TConst(Bottom) + } + } } }