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

Groovy fails to compile assignment operators on boolean array

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0-alpha-1, 2.4.15
    • Fix Version/s: 2.4.16
    • Component/s: class generator
    • Labels:
      None

      Description

      Groovy fails to compile:

      boolean[] b = [true]; b[0] &= false;

      with an error:

      Caught: BUG! exception in phase 'class generation' in source unit 'script_from_command_line' should not reach here
      BUG! exception in phase 'class generation' in source unit 'script_from_command_line' should not reach here

      when running:

      groovy -e "boolean[] b = [true]; b[0] &= false;"

      Alternative formats work fine, such as:

      groovy -e "boolean[] b = [true]; b[0] = false && b[0];"

      Similarly affects |= and ^= operators.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                paulk Paul King
                Reporter:
                tony_parasoft Tony Yoshicedo
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: