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

Auto-conversion inconsistency in BigDecimal treatment in method calls - Double vs Float

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.0
    • 1.6.8, 1.7.1, 1.8-beta-1
    • None
    • None

    Description

      As reported by Peter on groovy user mailing list - :

      class Foo {
       double myDouble
       float myFloat
      }
      
      def foo = new Foo()
      
      // OK
      foo.setMyDouble 0.1
      
      /* groovy.lang.MissingMethodException: No signature of method: Foo.setMyFloat() 
      is applicable for argument types: (java.math.BigDecimal) values: 0.1] */
      foo.setMyFloat 0.1  
      

      Attachments

        Activity

          People

            roshandawrani Roshan Dawrani
            roshandawrani Roshan Dawrani
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: