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

covariant method addition causing call to abstract method

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.0-rc-2, 1.8.9, 2.0.7
    • Component/s: None
    • Labels:
      None

      Description

      Executing the code below

                  class A {}
                  class B extends A {}
                  interface Contract {
                      A method()
                  }
                  abstract class AbstractContract implements Contract {}
                  class ContractImpl extends AbstractContract {
                      B method(String foo='default') { new B() }
                  }
                  new ContractImpl().method()
      

      fails because ContractImpl#super$1$method():A tries to call Contract#method.

        Attachments

          Activity

            People

            • Assignee:
              blackdrag Jochen Theodorou
              Reporter:
              blackdrag Jochen Theodorou
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: