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

Groovy 3.0.1 : @Delegate does not work with default getter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.1
    • 4.0.0-alpha-1, 3.0.2
    • Compiler
    • None
    • macOS Catalina
      Version: 10.15.3

    Description

      It looks like the default getter for a property is not picked up by the @Delegate. For example the below code:

      interface Foo {
          String getName()
      }
      
      class Bar {
          String name
      }
      
      class FooImpl implements Foo {
          @Delegate(includes = "getName") Bar bar
      }
      

      throws a compile-time error as:

      1 compilation error:
      
      Error during @Delegate processing: 'includes' property or method 'getName' does not exist.
       at line: 10, column: 5
      

      Please note that I have also tested with the latest 3.0.2-SNAPSHOT.

      Attachments

        Issue Links

          Activity

            People

              paulk Paul King
              behlp Puneet Behl
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: