A major Alice bug

(Display Listing 4.)

Alice has a bug that limits the usefulness of arrays.

The code in Listing 4 runs okay until the last statement is encountered.

The last statement causes a runtime error.

This makes it impossible to populate an array element using the contents of a variable.

Listing 4. Source code for the program named ArrayErr01.
  public void main ( ) {
    Number[] anArray = ; Number data = 0 ; Number moreData = 10 ;
       // Store literal value in anArray[0]
  anArray [ 0 ] = 2 ;
  data .set( value , ( anArray [ 0 ] ) );
  print( ( data .toString() ) );
  // Store variable's value in anArray[1]
  // The following statement causes a runtime error.
  anArray [ 1 ] = moreData ;
  }