hardcode variables for empty records and tag unions

This commit is contained in:
Folkert 2020-03-07 00:25:16 +01:00
parent 2270d2c30d
commit eb7d9d98e6
4 changed files with 14 additions and 13 deletions

View file

@ -472,16 +472,8 @@ fn type_to_variable(
register(subs, rank, pools, content)
}
EmptyRec => {
let content = Content::Structure(FlatType::EmptyRecord);
register(subs, rank, pools, content)
}
EmptyTagUnion => {
let content = Content::Structure(FlatType::EmptyTagUnion);
register(subs, rank, pools, content)
}
EmptyRec => Variable::EMPTY_RECORD,
EmptyTagUnion => Variable::EMPTY_TAG_UNION,
// This case is important for the rank of boolean variables
Boolean(boolean_algebra::Bool(Atom::Variable(var), rest)) if rest.is_empty() => *var,