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

@CompileStatic VerifyError

    XMLWordPrintableJSON

    Details

      Description

      class FailsVerification {
          static class Nested {
              @groovy.transform.CompileStatic
              static method() {
                  def closure = {-> println 'foo' }
                  closure()
              }
          }
      
          public static void main(String[] args) {
              Nested.method()
          }
      }
      

      If we call the closure through call() it works:

      class Works{
          static class Nested {
              @groovy.transform.CompileStatic
              static method() {
                  def closure = {-> println 'foo' }
                  closure.call()
              }
          }
      
          public static void main(String[] args) {
              Nested.method()
          }
      }
      

        Attachments

          Activity

            People

            • Assignee:
              melix C├ędric Champeau
              Reporter:
              ddimitrov Dimitar Dimitrov
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: