eliaperantoni commented on code in PR #13664: URL: https://github.com/apache/datafusion/pull/13664#discussion_r1931797862
########## datafusion/expr-common/src/type_coercion/binary.rs: ########## @@ -68,11 +70,57 @@ impl Signature { } } -/// Returns a [`Signature`] for applying `op` to arguments of type `lhs` and `rhs` -fn signature(lhs: &DataType, op: &Operator, rhs: &DataType) -> Result<Signature> { - use arrow::datatypes::DataType::*; - use Operator::*; - match op { +pub struct BinaryTypeCoercer<'a> { + lhs: &'a DataType, + op: &'a Operator, + rhs: &'a DataType, + + lhs_spans: Spans, Review Comment: We need the spans of both sides individually though, to produce diagnostics like the following:  Maybe it's not super clear from the screenshot but each `note: has type X` is highlighting just one side of the expression. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org