First pass constraining crash

This commit is contained in:
Ayaz Hafiz 2022-11-02 15:03:17 -05:00
parent ee5eacc3e4
commit 9dc489c2b0
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
8 changed files with 127 additions and 13 deletions

View file

@ -482,6 +482,12 @@ pub fn constrain_expr(
let and_constraint = constraints.and_constraint(and_cons);
constraints.exists(vars, and_constraint)
}
Expr::Crash => {
let crash_type_index = constraints.push_type(Type::Crash);
let expected_index = constraints.push_expected_type(expected);
constraints.equal_types(crash_type_index, expected_index, Category::Crash, region)
}
Var(symbol, variable) => {
// Save the expectation in the variable, then lookup the symbol's type in the environment
let expected_type = *constraints[expected].get_type_ref();