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

weird verify error with TupleConstructor and Lazy

    XMLWordPrintableJSON

    Details

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

      Description

      This script:

      @groovy.transform.TupleConstructor
      class Picker {
        @Lazy result = foo()
      }
      new Picker()
      

      gives this error:

      java.lang.VerifyError: (class: Picker, method: <init> signature: ()V) Expecting to find object/array on stack
      
      	at java.lang.Class.getDeclaredConstructors0(Native Method)
      
      	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2483)
      
      	at java.lang.Class.getDeclaredConstructors(Class.java:1891)
      
      	at org.codehaus.groovy.reflection.CachedClass$2$1.run(CachedClass.java:69)
      

      Also, this script:

      @groovy.transform.TupleConstructor
      class Picker {
        @Lazy result = null
      }
      new Picker()
      

      gives this error:

      groovy.lang.ReadOnlyPropertyException: Cannot set readonly property: result for class: Picker
      

        Attachments

          Activity

            People

            • Assignee:
              paulk Paul King
              Reporter:
              paulk Paul King
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: