Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-6841

BUG! exception in phase 'semantic analysis'

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.0, 2.3.2
    • 2.3.3
    • Compiler
    • None

    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)

      Attachments

        Activity

          People

            melix Cédric Champeau
            pablo72 paolo di tommaso
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: