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

GCE in elvis assignment evaluation

    XMLWordPrintableJSON

Details

    Description

      @groovy.transform.CompileStatic
      def foo() {
        def a = 0
        a ?= 1
        println a // 1
        def b = 0
        b ?= "hello"
        println b // expected: "hello", actual: "GroovyCastException: Cannot cast 'String' to 'int'"
      }
      
      foo()
      

      Attachments

        Issue Links

          Activity

            People

              daniel_sun Daniel Sun
              daniilo Daniil Ovchinnikov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: