fixup! Reproduce principality bug

This commit is contained in:
Richard Feldman 2020-01-01 17:02:50 -05:00
parent 452e59c7a3
commit e23bff79ac

View file

@ -248,9 +248,21 @@ mod test_load {
"Principal.identity" => "a -> a",
};
assert_eq!(expected_types.len(), module.defs.len());
assert_eq!(expected_types.len(), module.declarations.len());
for def in module.defs {
for decl in module.declarations {
let def = match decl {
Declare(def) => def,
rec_decl @ DeclareRec(_) => {
panic!(
"Unexpected recursive def in module declarations: {:?}",
rec_decl
);
}
cycle @ InvalidCycle(_, _) => {
panic!("Unexpected cyclic def in module declarations: {:?}", cycle);
}
};
for (symbol, expr_var) in def.pattern_vars {
let content = subs.get(expr_var).content;