mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
Expose type mismatches between recursive types and types that aren't
Closes #2166
This commit is contained in:
parent
ee05d13802
commit
e54917a063
2 changed files with 43 additions and 1 deletions
|
@ -285,7 +285,12 @@ fn unify_structure(
|
|||
// unify the structure with this unrecursive tag union
|
||||
unify_pool(subs, pool, ctx.first, *structure, ctx.mode)
|
||||
}
|
||||
_ => todo!("rec structure {:?}", &flat_type),
|
||||
// Only tag unions can be recursive; everything else is an error.
|
||||
_ => mismatch!(
|
||||
"trying to unify {:?} with recursive type var {:?}",
|
||||
&flat_type,
|
||||
structure
|
||||
),
|
||||
},
|
||||
|
||||
Structure(ref other_flat_type) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue