Community
Participate
Working Groups
Paul, based on our discussion, we need a utility method to calculate what the type would be based upon an expression (or binary expression -- needs to handle the parm as expression), like was done in RBD
After more talking with people, we believe the best approach is not to make a utility, but have the type of expressions/binary expressions precalculated and stored in the ir itself as the new type. This would make it so the generators would not need to change in any way.
I am setting this to blocking, because this is really needed so we can complete the work of making non-parameterized Decimal type be a reference type. Right now, binary expressions whose operations have a return type of EDecimal are being treated as reference. This is causing unneccessary boxing expressions to be generated.
I have added a utility named ArithmeticTypeAnalyzer. You can use the getType() method, and pass in a binary expression. If the binary expression is an arithmetic expression, whose operation returns a generic Decimal, it will attempt to use the characteristics of the 2 operands to determine the length and number of decimal places to use for the Decimal type. This method defaults to returning the type of the operation if it is unable to compute the type, or if the binary expression is not arithmetic.
This high severity defect was fixed several weeks ago, so I am closing.