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

Incorrect compile time access error is raised when using @CompileStatic and/or @TypeChecked

    XMLWordPrintableJSON

Details

    Description

      after 3.0.0-beta-1 was released, my project will no longer compile (it would compile against alpha-4)

      Most of the classes are annotated with

      @TypeChecked
      @CompileStatic

      the error produced takes the form

      Compiling with JDK Java compiler API.
      startup failed:
      .../kvdn/src/main/groovy/net/iowntheinter/kvdn/storage/kv/impl/KvOp.groovy: 123: Access to java.lang.Object#D is forbidden @ line 123, column 17.
                         D.getMap(this.strAddr, { AsyncResult<AsyncMap> res ->
      

      I believe the relevant code sections are:

       

      @TypeChecked
      @CompileStatic
      class KvOp extends KvdnOperation implements KVOperation {
          public KVData D
      
      
      ...................
      
      
      
          @Override
          @TypeChecked
          void submit(..........) {
      .................
      
              startOperation(this.valueType, TXTYPE.KV_SUBMIT, key, content, {
      /*(ln123)*/    D.getMap(this.strAddr, { AsyncResult<AsyncMap> res ->
         .....................
                  })
              })
          }
      
      
      

       

       

       

      Attachments

        Issue Links

          Activity

            People

              daniel_sun Daniel Sun
              cinterloper Grant Haywood
              Votes:
              0 Vote for this issue
              Watchers:
              2 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