Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 353902

Summary: need a typeutils method to calculate the type based upon the expression
Product: z_Archived Reporter: Jeff Douglas <jeffdouglas>
Component: EDTAssignee: Project Inbox <edt.mofmodel-inbox>
Status: CLOSED FIXED QA Contact:
Severity: blocker    
Priority: P3 CC: greer, pharmon
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Jeff Douglas CLA 2011-08-04 11:08:51 EDT
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
Comment 1 Jeff Douglas CLA 2011-08-04 11:26:26 EDT
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.
Comment 2 Paul Harmon CLA 2011-08-25 13:22:27 EDT
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.
Comment 3 Paul Harmon CLA 2011-09-13 08:01:10 EDT
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.
Comment 4 Lisa Lasher CLA 2011-11-09 14:13:33 EST
This high severity defect was fixed several weeks ago, so I am closing.