<div dir="ltr">Hi,<div><br></div><div>I have not found anything in JLS specifically mentioning this. So, I'm not sure if it is intentional, but the following code does not compile (in any versions of Java I have tried):</div><div><br></div><div>```</div><div>interface ForEachable<T> {<br>  void forEach(Consumer<? super T> consumer);<br>}<br><br>List<String> wrongMethod(ForEachable<? extends String[]> arrays) {<br>  var result = new ArrayList<String>();<br>  arrays.forEach(array -> result.add(array[0]));<br>  return result;<br>}<br></div><div>```</div><div><br></div><div>or in an even simpler example:</div><div><br></div><div>```</div><div>String first(Supplier<? extends String[]> supplier) {<br>  return supplier.get()[0];<br>}<br></div><div>```</div><div><br></div><div>The compiler complains about `array[0]` that `array` is not an array. While I get that the compiler cannot assume that there is no subtype of `String[]`, but even if there was one, I would expect it to be an array, and be indexable.</div><div><br></div><div>An obvious workaround is to assign `array` to a new local variable, but it is awkward to do.</div><div><br></div><div>Is this behavior a bug, or something required by the JLS?</div><div><br></div><div>Thanks,</div><div>Attila</div></div>