Acknowledged
over 1 year ago

Parser issue with parenthesized array assignment expressions

Given a function foo() that returns an array, you can write

  foo()[1] = 42;

and the compiler accepts it.

but

  (foo() as Array<Number>)[1] = 42;

is a parser error.

And so is

  (foo())[1] = 42;

  ...: no viable alternative at input '(foo())[1]='

There doesn't seem to be any reason not to support either of these, since they would compile to the exact same bytecode.