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

final modifier ignored in scripts

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 1.0-JSR-6
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      JSR-6, JDK1.5, Windows XP

      Description

      The simple script:

      println "Hello World"
      final foo = "Foo is final"
      println foo
      foo = "Yet foo has changed"
      println foo

      outputs:
      Hello World
      Foo is final
      Yet foo has changed

      groovy should error when the final variable foo is re-assigned

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                macleoa Alasdair MacLeod
              • Votes:
                1 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: