Unify variables directly when possible

instead of going through a solved type
This commit is contained in:
Folkert 2021-08-22 16:29:57 +02:00
parent 1348ec433b
commit ecba687243
3 changed files with 141 additions and 49 deletions

View file

@ -554,10 +554,10 @@ impl<'a> LambdaSet<'a> {
}
Ok(()) | Err((_, Content::FlexVar(_))) => {
// TODO hack for builting functions.
// this can happen when there is a type error somewhere
Ok(LambdaSet {
set: &[],
representation: arena.alloc(Layout::Struct(&[])),
representation: arena.alloc(Layout::Union(UnionLayout::NonRecursive(&[]))),
})
}
_ => panic!("called LambdaSet.from_var on invalid input"),