mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Deduplicate capture niches
This commit is contained in:
parent
91050d9989
commit
3385c708c6
2 changed files with 29 additions and 0 deletions
|
@ -1009,6 +1009,11 @@ impl<'a> LambdaSet<'a> {
|
|||
joined.sort_by(|(lam_and_captures1, _), (lam_and_captures2, _)| {
|
||||
lam_and_captures1.cmp(lam_and_captures2)
|
||||
});
|
||||
// Remove duplicate lambda captures layouts unification can't see as
|
||||
// duplicates, for example [[Thunk {a: Str}, Thunk [A Str]]], each of which are
|
||||
// newtypes over the lambda layout `Thunk Str`.
|
||||
joined.dedup_by_key(|((name, captures), _)| (*name, *captures));
|
||||
|
||||
let (set, set_with_variables): (std::vec::Vec<_>, std::vec::Vec<_>) =
|
||||
joined.into_iter().unzip();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue