more comment

This commit is contained in:
Douglas Creager 2025-12-14 21:51:56 -05:00
parent 92894d3712
commit 649c7bce58
1 changed files with 3 additions and 1 deletions

View File

@ -1326,7 +1326,9 @@ impl<'db> Node<'db> {
}
// If we reach the `true` terminal, the path we've been following represents one
// representative type.
// representative type. Before constructing the final lower and upper bound, sort
// the constraints by their source order. This should give us a consistently
// ordered specialization, regardless of the variable ordering of the original BDD.
current_bounds.sort_unstable_by_key(|bounds| bounds.source_order);
let greatest_lower_bound =
UnionType::from_elements(db, current_bounds.iter().map(|bounds| bounds.lower));