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

@CompileStatic is not propagated to anonymous class

    XMLWordPrintableJSON

Details

    Description

      @groovy.transform.CompileStatic
      def method() {
          new Runnable() {
              @Override
              void run() {
                  foo // invalid reference
              }
          }
      } 

      Expected: Error:(6, 13) Groovyc: [Static type checking] - The variable [foo] is undeclared.
      Actual: no error is reported.

      Note that annotating run method works properly, i.e. the error is reported.

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              daniilo Daniil Ovchinnikov
              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 - 40m
                  40m