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

Static method call within trait is not transformed properly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.0-beta-2
    • Fix Version/s: 2.3.0-rc-1
    • Component/s: None
    • Labels:
      None

      Description

      In the following example, the LOGGER receiver in the info method of the trait doesn't delegate to the class receiver, leading to a runtime error.

      import java.util.logging.Logger
      
                  trait Loggable {
      
                      static def LOGGER = Logger.getLogger(this.class.name)
      
                      void info(String msg) {
                          LOGGER.info(msg)
                      }
                  }
      
                  class Test implements Loggable {}
      
                  def t = new Test()
                  t.info('foo')
      

        Attachments

          Activity

            People

            • Assignee:
              melix Cédric Champeau
              Reporter:
              melix Cédric Champeau
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: