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

Traits defining getter conflicts with generated getter (improvements for pre-compiled case)

    XMLWordPrintableJSON

Details

    Description

      class Foo { }
      trait GetFoo {
          abstract Foo getFoo()
      }
      class BaseFooSpec {
          Foo foo
      }
      class FooSpec extends BaseFooSpec implements GetFoo { }
      

      Generates a stub for FooSpec with

      public class FooSpec
        extends BaseFooSpec  implements
          GetFoo,    groovy.lang.GroovyObject {
      ;
      @groovy.transform.Generated() @groovy.transform.Internal() public  groovy.lang.MetaClass getMetaClass() { return (groovy.lang.MetaClass)null;}
      @groovy.transform.Generated() @groovy.transform.Internal() public  void setMetaClass(groovy.lang.MetaClass mc) { }
      @groovy.transform.Generated() @groovy.transform.Internal() public  java.lang.Object invokeMethod(java.lang.String method, java.lang.Object arguments) { return null;}
      @groovy.transform.Generated() @groovy.transform.Internal() public  java.lang.Object getProperty(java.lang.String property) { return null;}
      @groovy.transform.Generated() @groovy.transform.Internal() public  void setProperty(java.lang.String property, java.lang.Object value) { }
      public abstract  Foo getFoo();
      }
      

      Note the getFoo() is still abstract instead of using the getter generated from BaseFooSpec.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h