From 81d18cc84beb94f655b68b9c4ec020432497eed1 Mon Sep 17 00:00:00 2001 From: Anton-4 <17049058+Anton-4@users.noreply.github.com> Date: Fri, 5 Jul 2024 14:17:52 +0200 Subject: [PATCH] use dead_code for `Both` Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com> --- crates/compiler/unify/src/unify.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/compiler/unify/src/unify.rs b/crates/compiler/unify/src/unify.rs index d71f7ccaab..765f73d040 100644 --- a/crates/compiler/unify/src/unify.rs +++ b/crates/compiler/unify/src/unify.rs @@ -2533,7 +2533,9 @@ enum Rec { None, Left(Variable), Right(Variable), - Both(Variable), + #[allow(dead_code)] + // dead_code because of https://github.com/roc-lang/roc/pull/6819/files#r1655317562 + Both(Variable, Variable), } /// Checks if an extension type `ext1` should be permitted to grow by the `candidate_type`, if it @@ -2995,8 +2997,8 @@ fn find_union_rec(subs: &Subs, ctx: &Context) -> Rec { subs.get_content_without_compacting(ctx.second), ) { (Structure(s1), Structure(s2)) => match (s1, s2) { - (FlatType::RecursiveTagUnion(l, _, _), FlatType::RecursiveTagUnion(_r, _, _)) => { - Rec::Both(*l) + (FlatType::RecursiveTagUnion(l, _, _), FlatType::RecursiveTagUnion(r, _, _)) => { + Rec::Both(*l, *r) } (FlatType::RecursiveTagUnion(l, _, _), _) => Rec::Left(*l), (_, FlatType::RecursiveTagUnion(r, _, _)) => Rec::Right(*r), @@ -3160,7 +3162,7 @@ fn unify_shared_tags_merge( let flat_type = match recursion_var { Rec::None => FlatType::TagUnion(new_tags, new_ext), - Rec::Left(rec) | Rec::Right(rec) | Rec::Both(rec) => { + Rec::Left(rec) | Rec::Right(rec) | Rec::Both(rec, _) => { debug_assert!(is_recursion_var(env, rec), "{:?}", env.dbg(rec)); FlatType::RecursiveTagUnion(rec, new_tags, new_ext) }