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

Delegation to an interface with deprecated methods shows a compile error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.6
    • 2.0.5, 2.1.0-beta-1, 1.8.9
    • Compiler
    • None
    • Max OS X 10.6.8, Mac Java, Eclipse 3.7

    Description

      Given an interface:

      public
      interface DeprecatedMethods {
      
          @Deprecated
          public void setHeight(float height);
      
      }
      

      and a delegating class:

      class DelegateDeprecated {
      	
          @Delegate	
          private DeprecatedMethods delegate
      	
      }
      

      then the compiler shows a compilation error:

      $ groovyc DelegateDeprecated.groovy
      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      DelegateDeprecated.groovy: 15: Can't have an abstract method in a non-abstract class. The class 'DelegateDeprecated' must be declared abstract or the method 'void setHeight(float)' must be implemented.
      @ line 15, column 1.
      class DelegateDeprecated {
      ^

      1 error

      This happens from the command line and Eclipse, and can be made to go away by removing the @Deprecated annotation.

      Attachments

        Activity

          People

            paulk Paul King
            prajnainc Paul Bennett
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: