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

(null as float) behaviour changed in 1.8

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 1.8-beta-3
    • 1.8-beta-4
    • None
    • None

    Description

      In Groovy 1.7.6, the following code works :

      assert null == null as float
      

      In Groovy 1.8.0-beta-3, it throws an error :

      org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'null' with class 'null' to class 'java.lang.Number'
      	at org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.castToNumber(DefaultTypeTransformation.java:139)
      	at org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.castToNumber(DefaultTypeTransformation.java:121)
      	at org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.floatUnbox(DefaultTypeTransformation.java:74)
      

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            melix Cédric Champeau
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: