feat: unify tuples and stdlib updates
This commit is contained in:
@@ -856,9 +856,17 @@ impl<'comments> Formatter<'comments> {
|
||||
match args {
|
||||
[arg] if is_breakable_expr(&arg.value) => self
|
||||
.expr(fun)
|
||||
.append(if needs_curly { "{" } else { "(" })
|
||||
.append(if needs_curly {
|
||||
break_(" {", " { ")
|
||||
} else {
|
||||
break_("(", "(")
|
||||
})
|
||||
.append(self.call_arg(arg, needs_curly))
|
||||
.append(if needs_curly { "}" } else { ")" })
|
||||
.append(if needs_curly {
|
||||
break_("}", " }")
|
||||
} else {
|
||||
break_(")", ")")
|
||||
})
|
||||
.group(),
|
||||
|
||||
_ => self
|
||||
|
||||
@@ -1200,6 +1200,19 @@ impl<'a> Environment<'a> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
(Type::Tuple { elems: elems1, .. }, Type::Tuple { elems: elems2, .. })
|
||||
if elems1.len() == elems2.len() =>
|
||||
{
|
||||
for (a, b) in elems1.iter().zip(elems2) {
|
||||
unify_enclosed_type(
|
||||
t1.clone(),
|
||||
t2.clone(),
|
||||
self.unify(a.clone(), b.clone(), location),
|
||||
)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
(
|
||||
Type::Fn {
|
||||
args: args1,
|
||||
|
||||
Reference in New Issue
Block a user