Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 353902 - need a typeutils method to calculate the type based upon the expression
Summary: need a typeutils method to calculate the type based upon the expression
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 blocker (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-04 11:08 EDT by Jeff Douglas CLA
Modified: 2017-02-23 14:16 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.