From 276dad56d7cbc3276dae4948d392649bb61ee1da Mon Sep 17 00:00:00 2001 From: greg Date: Sat, 3 Mar 2018 11:55:20 -0800 Subject: [PATCH] Handle tuple literals in type system --- src/schala_lang/typechecking.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/schala_lang/typechecking.rs b/src/schala_lang/typechecking.rs index df78034..4b72884 100644 --- a/src/schala_lang/typechecking.rs +++ b/src/schala_lang/typechecking.rs @@ -224,8 +224,14 @@ impl TypeContext { } Ok(tf) }, + &TupleLiteral(ref expressions) => { + let mut types = vec![]; + for expr in expressions { + types.push(self.infer(expr)?); + } + Ok(Sum(types)) + }, /* - TupleLiteral(Vec), Index { indexee: Box, indexers: Vec,