Improve type inference #4747
Replies: 1 comment 2 replies
-
Really not sure what you are proposing here exactly, so hard to say. Should we "improve" things where there is an opportunity? Yes, of course. Kind of depends on details. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Right now, we always try to determine the
MappingModelExpressible
inBaseSqmToSqlAstConverter
by looking at an SQM node, but for certain expressions/predicates e.g. binary arithmetic or comparison predicate, we could instead make use ofExpression#getExpressionType
of the "other side". For example, if we first translate the LHS and then the RHS of a comparison predicate likepath = :param
, it would be much better to use the expression type of the LHS to infer the type of the RHS.A possible downside of this would be, that we probably wouldn't figure out issues in the
determineValueMapping
function so fast because usually the LHS in expressions/predicates is a typed node.Any reason for not applying this improvement?
We currently do something like this:
whereas we could do this:
Beta Was this translation helpful? Give feedback.
All reactions