| Summary: | Implement conversions between strings and numeric types | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Matt Heitz <mheitz> |
| Component: | EDT | Assignee: | Project Inbox <edt.mofmodel-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | jeffdouglas |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
Matt Heitz
Implement conversions between strings and numeric types done There is a problem with this type of statement: asmallint = astring + asmallint; this java code gets generated: asmallint = ESmallint.asSmallint(((astring) + ESmallint.ezeBox(asmallint))); the ezeBox is returning a ESmallint object and when this gets concatenated to the string variable, the name of the class is the data part. either the boxing should not occur, or an unbox needs to be done after the boxing. i believe this might be a definition problem in the narrowing/expanding options in the egl setup tables for the types. Paul. Matt and I discussed this at length and the problem in the in getOperation method of makeCompatible for Binary expressions.
When the lhs type is string and the rhs is a numeric type, this logic is causing the rhs to be converted to eglany, when it should be converted to a string instead
public static void makeCompatible(BinaryExpression expr, Type type1, Type type2) {
Operation op = expr.getOperation();
Expression asExpr;
Type parmType1 = op.getParameters().get(0).getType();
Type parmType2 = op.getParameters().get(1).getType();
Ignore the last comment Paul. By coding the toString classes in the runtime, this seems to work. Closing. |