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

@CompileStatic fails to compile when using constants declared on interfaces implemented by super class

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 2.1.3
    • 2.1.4
    • Static compilation
    • None
    • Windows 7, Java 6, Groovy 2.1.3

    Description

      The following class gives the compilation error: [Static type checking] - The variable [CONSTANT_STRING] is undeclared.

      import groovy.transform.CompileStatic
      
      @CompileStatic class MyClass extends MySuperClass {
          MyClass() {
              println CONSTANT_STRING
          }
      }
      
      @CompileStatic class MySuperClass implements MyInterface {
      }
      
      @CompileStatic interface MyInterface {
          String CONSTANT_STRING = 'abc'
      }
      

      Attachments

        Activity

          People

            melix Cédric Champeau
            bborchardt Brett Borchardt
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: