Community
Participate
Working Groups
program arrayPlus type BasicProgram {} myNames string[] = ["Carolina", "State", "Duke"]; element string = "Meredith"; newList1 string[]; newList2 string[]; function main() newList1 = myNames + element; // Works try newList2 = element + myNames; // Croaks onException(oops anyexception) SysLib.writeStdout(oops.message); end end end The value [Carolina, State, Duke] of type java.util.ArrayList cannot be converted to the type org.eclipse.edt.runtime.java.eglx.lang.EString. eglx.lang.TypeCastException The value [Carolina, State, Duke] of type java.util.ArrayList cannot be converted to the type org.eclipse.edt.runtime.java.eglx.lang.EString. at eglx.lang.AnyException.fillInStackTrace(AnyException.java:187) at java.lang.Throwable.<init>(Throwable.java:181) at java.lang.Exception.<init>(Unknown Source) at java.lang.RuntimeException.<init>(Unknown Source) at eglx.lang.AnyException.<init>(AnyException.java:32) at eglx.lang.TypeCastException.<init>(TypeCastException.java:24) at org.eclipse.edt.runtime.java.eglx.lang.EAny.ezeCast(EAny.java:100) at org.eclipse.edt.runtime.java.eglx.lang.EString.ezeCast(EString.java:63) at pkg.arrayPlus.main(arrayPlus.java:42) at org.eclipse.edt.javart.resources.RunUnitBase.start(RunUnitBase.java:244) at pkg.arrayPlus.main(arrayPlus.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.edt.javart.ide.MainProgramLauncher.main(MainProgramLauncher.java:68)
This looks like incorrect EGL to me. Brian agreed. I'm putting this over to the compiler, so that it can be validated out as incorrect EGL.
The second case should insert the string as the first element of the array. I am sending this back to javagen. The ReorgCode class should turn this into an InsertElement, just like it turns the first contenation in this example into an ApplendElement
fixed
Verified in 20111103 build.