Skip to content

Commit

Permalink
use dead_code for Both
Browse files Browse the repository at this point in the history
Signed-off-by: Anton-4 <[email protected]>
  • Loading branch information
Anton-4 authored Jul 5, 2024
1 parent d921d77 commit 81d18cc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions crates/compiler/unify/src/unify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -3160,7 +3162,7 @@ fn unify_shared_tags_merge<M: MetaCollector>(

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)
}
Expand Down

0 comments on commit 81d18cc

Please sign in to comment.