mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-24 18:52:58 +03:00
fmt fix
This commit is contained in:
parent
019598c84e
commit
ca3fb11bc3
@ -168,14 +168,14 @@ impl<'a> TypeChecker<'a> {
|
||||
let t1 = self.compare_expr_type(&binary.left, None, binary.left.span());
|
||||
let t2 = self.compare_expr_type(&binary.right, None, binary.right.span());
|
||||
|
||||
|
||||
// Allow `group` * `scalar` multiplication.
|
||||
match (t1.as_ref(), t2.as_ref()) {
|
||||
(Some(Type::Group), Some(other)) => {
|
||||
self.assert_type(t1.unwrap(), expected, binary.left.span());
|
||||
self.assert_type(*other, Some(Type::Scalar), binary.span());
|
||||
Some(Type::Group)
|
||||
} (Some(other), Some(Type::Group)) => {
|
||||
}
|
||||
(Some(other), Some(Type::Group)) => {
|
||||
self.assert_type(t2.unwrap(), expected, binary.left.span());
|
||||
self.assert_type(*other, Some(Type::Scalar), binary.span());
|
||||
Some(Type::Group)
|
||||
|
@ -78,9 +78,11 @@ impl<'a> TypeChecker<'a> {
|
||||
|
||||
pub(crate) fn assert_eq_types(&self, t1: Option<Type>, t2: Option<Type>, span: Span) {
|
||||
match (t1, t2) {
|
||||
(Some(t1), Some(t2)) if t1 != t2 => self.handler
|
||||
(Some(t1), Some(t2)) if t1 != t2 => self
|
||||
.handler
|
||||
.emit_err(TypeCheckerError::type_should_be(t1, t2, span).into()),
|
||||
(Some(type_), None) | (None, Some(type_)) => self.handler
|
||||
(Some(type_), None) | (None, Some(type_)) => self
|
||||
.handler
|
||||
.emit_err(TypeCheckerError::type_should_be("no type", type_, span).into()),
|
||||
_ => {}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user