From cd5fc36c3729165256fdcca589b56d24979ec8ba Mon Sep 17 00:00:00 2001 From: greg Date: Wed, 11 Oct 2017 16:43:04 -0700 Subject: [PATCH] Fix type check macro to add symbol table --- src/schala_lang/type_check.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/schala_lang/type_check.rs b/src/schala_lang/type_check.rs index c680e7d..a35c28f 100644 --- a/src/schala_lang/type_check.rs +++ b/src/schala_lang/type_check.rs @@ -401,6 +401,7 @@ mod tests { { let mut tc = TypeContext::new(); let ast = parse(tokenize($input)).0.unwrap() ; + tc.add_symbols(&ast); assert_eq!($correct, tc.type_check(&ast).unwrap()) } } @@ -409,6 +410,6 @@ mod tests { #[test] fn basic_inference() { type_test!("30", TConst(Integer)); - type_test!("1 + 2", TConst(Integer)); + type_test!("fn x(a: Int): Bool {}; x(1)", TConst(Boolean)); } }