From bb06bcd7f1ffcab75e034570d918cf048463181c Mon Sep 17 00:00:00 2001 From: Ayaz Hafiz Date: Thu, 21 Apr 2022 10:26:16 -0400 Subject: [PATCH] Fix compile error --- compiler/unify/src/unify.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/compiler/unify/src/unify.rs b/compiler/unify/src/unify.rs index 0c8f8562a5..88bf2456ca 100644 --- a/compiler/unify/src/unify.rs +++ b/compiler/unify/src/unify.rs @@ -577,15 +577,15 @@ fn unify_structure( RecursionVar { structure, .. } => match flat_type { FlatType::TagUnion(_, _) => { // unify the structure with this unrecursive tag union - let mut problems = unify_pool(subs, pool, ctx.first, *structure, ctx.mode); + let mut outcome = unify_pool(subs, pool, ctx.first, *structure, ctx.mode); - if problems.is_empty() { - problems.extend(fix_tag_union_recursion_variable( + if outcome.mismatches.is_empty() { + outcome.union(fix_tag_union_recursion_variable( subs, ctx, ctx.first, other, )); } - problems + outcome } FlatType::RecursiveTagUnion(rec, _, _) => { debug_assert!(is_recursion_var(subs, *rec)); @@ -594,15 +594,15 @@ fn unify_structure( } FlatType::FunctionOrTagUnion(_, _, _) => { // unify the structure with this unrecursive tag union - let mut problems = unify_pool(subs, pool, ctx.first, *structure, ctx.mode); + let mut outcome = unify_pool(subs, pool, ctx.first, *structure, ctx.mode); - if problems.is_empty() { - problems.extend(fix_tag_union_recursion_variable( + if outcome.mismatches.is_empty() { + outcome.union(fix_tag_union_recursion_variable( subs, ctx, ctx.first, other, )); } - problems + outcome } // Only tag unions can be recursive; everything else is an error. _ => mismatch!( @@ -707,7 +707,7 @@ fn fix_tag_union_recursion_variable( if !has_recursing_recursive_variable { merge(subs, ctx, *recursion_var) } else { - vec![] + Outcome::default() } }