Community
Participate
Working Groups
Bug 382296 was opened because we were generating an AS expression when making type1 compatible with type2, and type1 is already a subclass of type2 (assuming both types are reference types). I was able to remove the AS expression, except when making a type compatible with ANY or NUMBER in javascript. This is because JS is coded to require the resulting type to contain the type signature of the source. This does not happen if the AS expression is not coded. However, this is an implementation detail. According to our .egl definitions, ANY is the superclass of all types, and NUMBER is the superclass of DECIMAL. So, assigning any reference type to an ANY, or assignigning a DECIMAL to a NUMBER should not require an AS expression. Java does not require the AS expression, but JS does. I think the JS generator should be changed to insert the AS expression for these cases, so we do not have to add the AS expression in IRUtils and force all generators to generate an AS expression. If this is implemented in the JS generator, org.eclipse.edt.mof.egl.utils.IRUtils.makeExprCompatibleToType() should be changed to remove the AS expression for these cases. There is a comment just above the line that creates the AS expression with the following text: //For now, must make special case for Any and Number to support JS
Deferring to Future. This won't be done in 0.8.2.