This commit is contained in:
Folkert 2020-10-28 01:13:04 +01:00
parent 1921b74ebb
commit ef1cee6c41
6 changed files with 354 additions and 123 deletions

View file

@ -876,6 +876,13 @@ pub enum UnionVariant<'a> {
}
pub fn union_sorted_tags<'a>(arena: &'a Bump, var: Variable, subs: &Subs) -> UnionVariant<'a> {
let var =
if let Content::RecursionVar { structure, .. } = subs.get_without_compacting(var).content {
structure
} else {
var
};
let mut tags_vec = std::vec::Vec::new();
let result = match roc_types::pretty_print::chase_ext_tag_union(subs, var, &mut tags_vec) {
Ok(()) | Err((_, Content::FlexVar(_))) | Err((_, Content::RecursionVar { .. })) => {