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

Groovy not checking generics information correctly for covariant methods implementing interfaces

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.6, 2.2.0-beta-1
    • 2.3.0-beta-1
    • Compiler
    • None

    Description

      For this class:

      class StringIterator implements Iterator<String> {
        void remove() { }
        boolean hasNext() { false }
        def next() { 3 }
      }
      

      The compiler should complain that next doesn't have return type String.

      Attachments

        Activity

          People

            paulk Paul King
            paulk Paul King
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: