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

Covariant override method regression

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.0.0-alpha-1, 4.0.4
    • 2.5.18, 3.0.12, 4.0.4
    • None
    • None

    Description

      Consider the following:

      @FunctionalInterface
      interface A<I, O> {
          O apply(I in)
      }
      interface B<X, Y> extends A<X, Y> {
      }
      class C implements B<Number, String> {
          @Override String apply(Number n) { '' }
      }
      

      Error ""Method 'apply' from class 'C' does not override method from its superclass or interfaces but is annotated with @Override."

      Attachments

        Activity

          People

            emilles Eric Milles
            emilles Eric Milles
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: