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

misleading error message for boolean assignment

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.3.0-beta-1
    • Static Type Checker
    • None

    Description

      The static compiler does not allow the assignment of literal null to a variable of type boolean. The compiler complains with this message: "Cannot assign value of type java.lang.Object to variable of type boolean"

      I consider this message being misleading since it is very well allowed to assign a value of type Object to a boolean,because it will be transformed using Groovy truth. According to that null will be transformed to false.

      So either the message should be improved or the check removed for the boolean case

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: