Community
Participate
Working Groups
The generated code for the line below throws an exception at run time. i1 int[] = new int[2]; The problem is that we're passing in Integer.class to the EglList constructor, and we're calling its newInstance method to create the elements of the list. But Integer doesn't have a default constructor, so it fails. The same problem can happen when list.resize() is called.
Fixed by creating an interface for objects that can create elements, and passing it to the constructor and the resize function. We have various implementors of the interface, to cover the various cases of list of primitives, objects, and multi-dimensional lists. Note that it's valid to declare an array of non-nullable anys without an initializer, like this: x any[]; You're also allowed to call resize on the array, but if new elements need to be added, the resize function will throw an exception. This is what Tim wants (it's better than having some special check that prevents you from calling resize on an array of anys).
Verified.