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

final modifier ignored in scripts

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 1.0-JSR-6
    • None
    • None
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: