diff --git a/typed/src/expression.rs b/typed/src/expression.rs index bb57834136..edaab576e6 100644 --- a/typed/src/expression.rs +++ b/typed/src/expression.rs @@ -331,10 +331,16 @@ impl<'ast> From> for Expression { Box::new(Expression::from(*expression.right)), Span::from(expression.span), ), - BinaryOperation::Ne => Expression::Not( - Box::new(Expression::from(expression.clone())), - Span::from(expression.span), - ), + BinaryOperation::Ne => { + let span = Span::from(expression.span); + let negated = Expression::Eq( + Box::new(Expression::from(*expression.left)), + Box::new(Expression::from(*expression.right)), + span.clone(), + ); + + Expression::Not(Box::new(negated), span.clone()) + } BinaryOperation::Ge => Expression::Ge( Box::new(Expression::from(*expression.left)), Box::new(Expression::from(*expression.right)),