mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
Fix compile error
This commit is contained in:
parent
939f413569
commit
bb06bcd7f1
1 changed files with 9 additions and 9 deletions
|
@ -577,15 +577,15 @@ fn unify_structure(
|
||||||
RecursionVar { structure, .. } => match flat_type {
|
RecursionVar { structure, .. } => match flat_type {
|
||||||
FlatType::TagUnion(_, _) => {
|
FlatType::TagUnion(_, _) => {
|
||||||
// unify the structure with this unrecursive tag union
|
// 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() {
|
if outcome.mismatches.is_empty() {
|
||||||
problems.extend(fix_tag_union_recursion_variable(
|
outcome.union(fix_tag_union_recursion_variable(
|
||||||
subs, ctx, ctx.first, other,
|
subs, ctx, ctx.first, other,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
problems
|
outcome
|
||||||
}
|
}
|
||||||
FlatType::RecursiveTagUnion(rec, _, _) => {
|
FlatType::RecursiveTagUnion(rec, _, _) => {
|
||||||
debug_assert!(is_recursion_var(subs, *rec));
|
debug_assert!(is_recursion_var(subs, *rec));
|
||||||
|
@ -594,15 +594,15 @@ fn unify_structure(
|
||||||
}
|
}
|
||||||
FlatType::FunctionOrTagUnion(_, _, _) => {
|
FlatType::FunctionOrTagUnion(_, _, _) => {
|
||||||
// unify the structure with this unrecursive tag union
|
// 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() {
|
if outcome.mismatches.is_empty() {
|
||||||
problems.extend(fix_tag_union_recursion_variable(
|
outcome.union(fix_tag_union_recursion_variable(
|
||||||
subs, ctx, ctx.first, other,
|
subs, ctx, ctx.first, other,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
problems
|
outcome
|
||||||
}
|
}
|
||||||
// Only tag unions can be recursive; everything else is an error.
|
// Only tag unions can be recursive; everything else is an error.
|
||||||
_ => mismatch!(
|
_ => mismatch!(
|
||||||
|
@ -707,7 +707,7 @@ fn fix_tag_union_recursion_variable(
|
||||||
if !has_recursing_recursive_variable {
|
if !has_recursing_recursive_variable {
|
||||||
merge(subs, ctx, *recursion_var)
|
merge(subs, ctx, *recursion_var)
|
||||||
} else {
|
} else {
|
||||||
vec![]
|
Outcome::default()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue