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

Boolean seems to support toBoolean() but yields incorrect results

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • None
    • 1.7.6, 1.8-beta-3
    • None
    • None

    Description

      This is curious (with groovy shipped with grails 1.3.4)

      boolean b = true
      def x = b.toBoolean()
      
      println x
      assert x
      

      1) where is no-arg toBoolean() coming from
      2) why does it return false for true input.

      Attachments

        Activity

          People

            guillaume Guillaume Sauthier
            marc@anyware.co.uk Marc Palmer
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: