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

Private methods in traits cause compile time error if the class implementing trait is statically compiled

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.3.8
    • 2.3.9, 2.4.0-rc-1
    • Compiler
    • None

    Description

      The following code causes a compile-time error, just because the class implementing the trait uses `@CompileStatic`:

      trait Foo {
         private int f(int x) { x }
         int foo() { f(2) }
      }
      
      @groovy.transform.CompileStatic
      class A implements Foo {}
      new A().foo()
      

      Attachments

        Issue Links

          Activity

            People

              melix Cédric Champeau
              melix Cédric Champeau
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: