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

Using @CompileStatic causes VerifierError

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.0-rc-3
    • 2.0-rc-4
    • Static compilation
    • None

    Description

      The following code:

      import groovy.transform.*
      
      @CompileStatic
      URL getDescriptorForPlugin(File pluginDir) {
          URL descriptor = null
          File baseFile = pluginDir.canonicalFile
          File basePluginFile = (File)baseFile.listFiles().find {  File it -> it.name.endsWith("GrailsPlugin.groovy")}
      
          if (basePluginFile?.exists()) {
               descriptor = new URL("http://grails.org")
          }
          return descriptor
      }
      

      Results in

      java.lang.VerifyError: (class: ConsoleScript6, method: getDescriptorForPlugin signature: (Ljava/io/File;)Ljava/net/URL;) Expecting to find integer on stack
      	at java.lang.Class.getDeclaredConstructors0(Native Method)
      	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
      	at java.lang.Class.getConstructor0(Class.java:2699)
      

      Attachments

        Activity

          People

            melix Cédric Champeau
            graemerocher Graeme Rocher
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: