Description
The following code raises a compiler BUG exception
@groovy.transform.InheritConstructors class Tuple<E> extends ArrayList<E> { public ListIterator<E> listIterator(final int index) { return new ListIterator<E>() { private final ListIterator<? extends E> i = Tuple.super.listIterator(index) public boolean hasNext() {return i.hasNext();} public E next() {return i.next();} public boolean hasPrevious() {return i.hasPrevious();} public E previous() {return i.previous();} public int nextIndex() {return i.nextIndex();} public int previousIndex() {return i.previousIndex();} public void remove() { throw new UnsupportedOperationException(); } public void set(E e) { throw new UnsupportedOperationException(); } public void add(E e) { throw new UnsupportedOperationException(); } }; } }
The critical line is
private final ListIterator<? extends E> i = Tuple.super.listIterator(index)