Fix type check macro to add symbol table

This commit is contained in:
greg 2017-10-11 16:43:04 -07:00
parent 0ea9bd3d95
commit 5f1c46cb87
1 changed files with 2 additions and 1 deletions

View File

@ -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));
}
}