Community
Participate
Working Groups
Create a package named pack1 and import the attached EGL file. When the file is run with the JS Generator, a ClassCastException is thrown on the array access. I believe the fix is to change ArrayAccessTemplate::genExpression to the following, but I am not positive: public void genExpression(ArrayAccess expr, Context ctx, TabbedWriter out) { Field field = null; if(expr.getArray() instanceof Name){ if (((Name) expr.getArray()).getNamedElement() instanceof Field) field = (Field) ((Name) expr.getArray()).getNamedElement(); } if (field != null && field.getContainer() != null && field.getContainer() instanceof Type) ctx.invoke(genContainerBasedArrayAccess, (Type) field.getContainer(), ctx, out, expr, field); else genArrayAccess(expr, ctx, out); }
Created attachment 202001 [details] Simle ArrayAccess testcase.
Brian, Verified the fix you provided and committed it.
Closing this defect.