Universally quantified type variables

Implement universally quantified type variables, both explicitly given
by the user and inferred by the type inference algorithm.
This commit is contained in:
Griffin Smith 2021-03-14 16:43:47 -04:00
parent 7960c3270e
commit ecb4c0f803
17 changed files with 634 additions and 111 deletions

41
tests/compile.rs Normal file
View file

@ -0,0 +1,41 @@
use std::process::Command;
use crate_root::root;
const FIXTURES: &[(&str, i32)] = &[("simple", 5), ("functions", 9)];
#[test]
fn compile_and_run_files() {
let ach = root().unwrap().join("ach");
for (fixture, exit_code) in FIXTURES {
println!(">>> Testing: {}", fixture);
println!(" Running: `make {}`", fixture);
assert!(
Command::new("make")
.arg(fixture)
.current_dir(&ach)
.spawn()
.unwrap()
.wait()
.unwrap()
.success(),
"make failed"
);
let out_path = ach.join(fixture);
println!(" Running: `{}`", out_path.to_str().unwrap());
assert_eq!(
Command::new(out_path)
.spawn()
.unwrap()
.wait()
.unwrap()
.code()
.unwrap(),
*exit_code,
);
println!(" OK");
}
}