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

misleading error message for boolean assignment

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.0-beta-1
    • Component/s: Static Type Checker
    • Labels:
      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

            • Assignee:
              melix C├ędric Champeau
              Reporter:
              blackdrag Jochen Theodorou
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: