chore: change logical operations order

This commit is contained in:
Shunsuke Shibayama 2024-09-02 19:38:41 +09:00
parent 57559b6b9f
commit 7cd895a30e
5 changed files with 12 additions and 13 deletions

View file

@ -1196,9 +1196,9 @@ impl<'c, 'l, 'u, L: Locational> Unifier<'c, 'l, 'u, L> {
// NG: (Int <: ?U); (?T <: Int)
(Or(l1, r1), Or(l2, r2)) | (And(l1, r1), And(l2, r2)) => {
if self.ctx.subtype_of(l1, l2) && self.ctx.subtype_of(r1, r2) {
let (l_sup, r_sup) = if self.ctx.subtype_of(l1, r2)
&& !l1.is_unbound_var()
let (l_sup, r_sup) = if !l1.is_unbound_var()
&& !r2.is_unbound_var()
&& self.ctx.subtype_of(l1, r2)
{
(r2, l2)
} else {